首页 > 代码库 > TabControl key Points

TabControl key Points

A TabControl contains tab pages, which are represented by TabPage objects that you add through the TabPages property. The order of tab pages in this collection reflects the order the tabs appear in the control.

The user can change the current TabPage by clicking one of the tabs in the control. You can also programmatically change the current TabPage by using one of the following TabControl properties:

  • SelectedIndex

  • SelectedTab

In .NET Framework 2.0, you can also use one of the following methods:

  • SelectTab

  • DeselectTab

In .NET Framework 2.0, you can respond when the current tab changes by handling one of the following events:

  • Deselecting

  • Deselected

  • Selecting

  • Selected

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.

Event => Selected -> lost/obsolete???