I am trying to draw rectangle but it is drawn just with a single click (with different lengths and widths) also it is going out of pictureBox area But i want it to start from where mouse key is pressed and end where mouse key is released. i think there is something wrong with my quardinate. Waiting for reply. Thanks [code] Dim x1, y1, x2, y2 As Integer Dim MD, MU As Point Dim mywidth As Integer Dim drawtool As String Dim drawpen As Pen Dim g As Graphics Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown MD = e.Location x1 = MD.X y1 = MD.Y End Sub Private Sub PictureBox1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseUp If e.Button = Windows.Forms.MouseButtons.Left Then MU = e.Location x2 = MD.X y2 = MD.Y DrawRectangle() End Sub Public Sub DrawRectangle() gr = PictureBox1.CreateGraphics Dim solidColorBrush As SolidBrush = New SolidBrush(Color.Red) Dim coloredPen As Pen = New Pen(solidColorBrush) coloredPen.Width = 3 coloredPen.Color = Color.Blue Dim drawArea2 As Rectangle = New Rectangle(x1, y1, x2, y2) gr.DrawRectangle(coloredPen, drawArea2) gr.Dispose() End Sub [End code]