![]() |
Managing the Tabs |
If you have many tab pages and the width of the tab control cannot show all tabs at the same time, the control would add two navigation arrows to its top right corner to let the user know that there are more property pages: |
By default, the navigation buttons would come up because the control uses a property that controls their availability. If you do not want the navigation arrows, select the tab control and, in the Properties window, set the MultiLine property to True. This would create cascading tabs and the user can simply select the desired property page from its tab:
Of course, you can also do this programmatically by assigning the TabControl::MultiLine to true. After setting the MultiLine property to true, depending on the number of tab pages, the control may have 2, 3 or more rows. To find out the number of rows that the tab control contains, you can get the value of the RowCount property of the TabControl class. This property is of type int.
When you specify the caption of a property page, its is resized to accommodate the string. This means that the tab would get enlarged or narrowed, depending on the length of the caption. As an alternative, you can make all tabs use the same width. To support this, the TabControl class is equipped with a property named SizeMode. The SizeMode property is based on the TabSizeMode enumeration that has three members: Normal (the default), Fixed, and FillToRight. To control the size mode at design time, on the form, select the tab control. In the Properties window, click SizeMode and select the desired option: Normal: Each tab would be resized to fit its caption:
Fixed: The designer would find out what tab has the longest caption. It would then use that length as the common width of all the other tabs:
If the tab control's MultiLine property is set to true, the designer would get the length of the longest string of the first (top) row:
That length would be used as the common length to all the tabs on all rows:
FillToRight: This option is valid only if the MultiLine property is set to true. With this option, the tabs on each row would be resized so that the total length of the rows fit the width of the tab control:
Besides, or in addition to, the size mode, you can control the widths of the tab by specifying your own width. To do this, first set the SizeMode property to true. Then, use the ItemSize property of the tab control to specify how much width you want to apply to all tabs of the control. |
|
|
||
| Previous | Copyright © 2007 FunctionX, Inc. | Next |
|
|
||