The GridPanel acts as a container for other graphical objects and exhibits the following characteristics:
A GridPanel can be dropped on a form from the Toolbox using the "Panel" tool.
A GridPanel can be pasted on a form from the clipboard.
A GridPanel can contain one or more objects including other Panels.
Objects can be moved out of a GridPanel.
Objects can be dropped into a GridPanel from the Toolbox.
Objects can be pasted into a GridPanel from the clipboard.
If a panel is deleted, all the objects that it contains are also deleted.
When a GridPanel contains other objects, all objects within the GridPanel are treated as a single entity. The objects can be moved with the GridPanel while maintaining their relative positions to the border of the GridPanel. The objects can inherit the presentation style applied to the GridPanel by using the properties selected for the GridPanel in the Properties window, unless the objects have their own individual presentation style applied to them. Note that the form itself is in fact a "parent" GridPanel.
A GridPanel shares the same qualities as a form, in that any object placed in the GridPanel inherits the visual attributes of the GridPanel. You can specify different visual attributes for any particular object or group of objects after they have been added to the GridPanel. If you want to return the changed visual attribute of an object to its original inherited value, select the object and the property that you want to reset, and then click Reset on the context menu.
Note: There is a unique property Value assigned to Buttons and Radio Buttons to accommodate their functionality when in a GridPanel or a form. There is also a Checked Value property specific to checkboxes. Refer to GridPanel Function for more information on how to use these objects in a GridPanel.
Property |
Function |
---|---|
Id | Read-only. By default, automatically generated. Id="GridPanel1" for the first inserted GridPanel, Id="GridPanel2" for the second, and so on. |
Name | Read-only. The value of this property is set to Static control. |
BackgroundColor | Specifies a background color for the object. Select a color from one of the tabs in the drop-down list. Note that you can specify a custom color. If you change this value you can revert to the default value specified for the parent object by right clicking the property and selecting Reset from the context menu. |
BackgroundImage | Specifies an image to appear in the background of the control. The image always appears as a tiled image. |
BorderStyle | Specifies the width or type of border to draw around the GridPanel. |
ControlType | Read-only. Specifies GridPanel as the type of object added to the form. |
Font | Specifies font attributes that are applied directly to the text appearing in the object. If you change this value, you can restore the default value specified for the parent object by right-clicking the property and clicking Reset on the context menu. |
ForegroundColor | Specifies a foreground color for the object. Select a color from one of the tabs in the drop-down list. Note that you can specify a custom color. If you change this value, you can restore to the default value specified for the parent object by right-clicking the property and clicking Reset on the context menu. |
Location | Specifies the point in pixels that represents the upper-left corner of the object relative to the upper-left corner of its container as an X and Y location. |
Size | Specifies the size of the object representing the height and width in pixels. |
TabIndex | Specifies the index that defines the tab order for the object. The TabIndex value of a GridPanel object defines the position of the GridPanel as a whole within the overall form tab order, relative to the other controls on the form outside the GridPanel. The TabIndex value of controls within the GridPanel defines the tab order within that GridPanel only. As you tab through a form, the tab order moves in the GridPanel according to the TabIndex value of the GridPanel object. Focus initially goes to the control within the GridPanel with the lowest TabIndex value, and the tab order then moves through all controls within the GridPanel in the TabIndex sequence. The tab order then moves outside the GridPanel to the control on the form with the next highest TabIndex value to the GridPanel object. |
ToolTip | Specifies an optional tooltip to appear when the user at runtime hovers the mouse over a control in Winforms. To view the tooltip in the Presentation Client, the user has to hover over the control and press the F1 key. This tooltip is visible only at runtime. |