I have used this code to draw an rectangle around the panel
vb Code:
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint With Panel1 e.Graphics.DrawRectangle(Pens.Gray, .Left - 1, .Top - 1, .Width + 1, .Height + 1) End With End Sub
but when the form is resized the rectangle isnt drawn properly. The panel has Left,R,T,B anchor.





Reply With Quote