imports system.drawing
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] CollapseGroupBox_Paint([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Windows.Forms.PaintEventArgs)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] g [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Graphics = e.Graphics [/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] theRec [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Rectangle = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Rectangle() [/SIZE]
[SIZE=2]theRec = ClientRectangle[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] theEdgeGrayColor [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Color = Color.FromKnownColor(KnownColor.Gray)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] thePen [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Pen = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] Pen(theEdgeGrayColor) [/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] theEndPosition [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2] = 20 + 1 [/SIZE]
[SIZE=2][COLOR=#008000]' manually draw the collapse box[/COLOR][/SIZE]
[SIZE=2]g.DrawLine(thePen, theRec.X + 8, theRec.Y + 5, theRec.X, theRec.Y + 5)[/SIZE]
[SIZE=2]g.DrawLine(thePen, theRec.X, theRec.Y + 5, theRec.X, theRec.Bottom - 2)[/SIZE]
[SIZE=2]g.DrawLine(thePen, theRec.X, theRec.Bottom - 2, theRec.Right - 1, theRec.Bottom - 2)[/SIZE]
[SIZE=2]g.DrawLine(thePen, theRec.Right - 2, theRec.Bottom - 2, theRec.Right - 2, theRec.Y + 5)[/SIZE]
[SIZE=2]g.DrawLine(thePen, theRec.Right - 2, theRec.Y + 5, theRec.X + theEndPosition, theRec.Y + 5)[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]