Results 1 to 11 of 11

Thread: Drawing an rectangle around the panel

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,158

    Drawing an rectangle around the panel

    I have used this code to draw an rectangle around the panel

    vb Code:
    1. Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
    2. With Panel1
    3.             e.Graphics.DrawRectangle(Pens.Gray, .Left - 1, .Top - 1, .Width + 1, .Height + 1)
    4.         End With
    5. End Sub


    but when the form is resized the rectangle isnt drawn properly. The panel has Left,R,T,B anchor.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width