TabPage controls represent the tabbed pages in a TabControl control. The order of tab pages in the TabControl..::.TabPages collection reflects the order of tabs in the TabControl control. To change the order of tabs in the control, you must change their positions in the collection by removing them and inserting them at new indexes.
TabPage controls are constrained by their container, so some of the properties inherited from the Control base class will have no effect, including Top, Height, Left, Width, Show, and Hide.
The tabs in a TabControl are part of the TabControl but not parts of the individual TabPage controls. Members of the TabPage class, such as the ForeColor property, affect only the client rectangle of the tab page, but not the tabs. Additionally, the Hide method of the TabPage will not hide the tab. To hide the tab, you must remove the TabPage control from the TabControl..::.TabPages collection.
Note: |
|---|
In
.NET Framework version 2.0, the tab is considered part of the tab page for determining when the Enter and Leave events of the TabPage occur. In earlier versions of the .NET Framework, the Enter and Leave events of the TabPage do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page.
|
For more information about how this control responds to the Focus and Select methods, see the following Control members: CanFocus, CanSelect, Focused, ContainsFocus, Focus, Select.
Note: |
|---|
Controls contained in a
TabPage are not created until the tab page is shown, and any data bindings in these controls are not activated until the tab page is shown.
|
In .NET Framework version 2.0, the UseVisualStyleBackColor property lets you indicate whether the background of the tab page should render using the current visual style. This occurs only when the UseVisualStyleBackColor and Application..::.RenderWithVisualStyles property values are both true and the Appearance property of the parent TabControl is Normal. Otherwise, the background is painted normally.