|
|
Title | Find the area in which you should place things in a GroupBox in VB .NET |
Keywords | DisplayRectangle, ClientRectangle, GroupBox |
Categories | VB.NET, Controls |
|
|
A control's ClientRectangle property gives a Rectangle representing the client area inside the control. This is not necessarily the same as the area in which you should draw or place things. The DisplayRectangle property gives that area. For example, in a GroupBox, the ClientRectangle includes the area used by the control's caption and borders.
This example makes two labels cover the ClientRectangle and DisplayRectangle in a GroupBox so you can see where they are.
|
|
Private Sub Form1_Load(ByVal sender As System.Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
lblClientRectangle.Bounds = GroupBox1.ClientRectangle
lblDisplayRectangle.Bounds = GroupBox1.DisplayRectangle
End Sub
|
|
Note that these properties are inherited from the Control class so IntelliSense doesn't list them. You need to type them yourself.
|
|
|
|
|
|