====== Tab ======
{{page>commctrl}}
{{page>commstyle}}
{|class="cboxtable"
|-
|class="cboxcell1"|{{ control_tab.gif |}}
|class="cboxcell2"|**TATab**
|}
Creates a tab control
See the tutorial, [[koda:documentation:creating_a_tab_control|]]
#remarks_header[Properties:]#
|**ActivePage**|{{KODA>VAR>ActivePage}} |
|**Align**|{{KODA>VAR>Align}} |
|**Color**|{{KODA>VAR>Color}} |
|**ContextMenu**|{{KODA>VAR>ContextMenu}} |
|**Cursor**|{{KODA>VAR>Cursor}} |
|**Enabled**|False generates GUICtrlSetState(-1, $GUI_DISABLE) |
|**Font**|{{KODA>VAR>Font}} |
|**Left,Top**|{{KODA>VAR>Left,Top}} |
|**Width,Height**|{{KODA>VAR>Width,Height}} |
|**Hint**|Text that appears when cursor hovers over control. Generates call to GUICtrlSetTip |
|**Images**| ImageList containing icons to show at tops of Pages (optional). [[control_imagelist|]] must already exist|
|**Name**|{{KODA>VAR>Name}} |
|**OnClick**|Generates (in Message Loop mode) a Case or (in OnEvent mode) a call to GUISetOnEvent and a skeleton event function. Double-click to right to open [[proped_events_editor]] |
|**Resizing**|{{KODA>VAR>Resizing}} |
|**TabOrder**|Sequence in which controls are selected with the Tab and S-Tab keys. For a Form and for each Group, TabOrder starts with 0. You may prefer to use the [[dialog_tab_order_editor|TabOrder Visual Editor]]: press C-t to open it. |
|**Visible**|If False, generates GUICtrlSetState(-1, $GUI_HIDE) |
#remarks_header[Styles:]#
|TCS_SCROLLOPPOSITE|Unneeded tabs scroll to the opposite side of the control when a tab is selected |
|TCS_BOTTOM|Page labels appear at the bottom of pages |
|TCS_FLATBUTTONS|With TCS_BUTTONS, buttons are two-dimensional |
|TCS_FORCEICONLEFT|Icon is at left edge of page label, leaving text centered. Requires TCS_FIXEDWIDTH |
|TCS_FORCELABELLEFT|Text is at left side of page label, icon next to it. Requires TCS_FIXEDWIDTH. Implies TCS_FORCEICONLEFT |
|TCS_HOTTRACK|Page label under cursor is highlighted. Requires TCS_BUTTONS |
|TCS_VERTICAL|Page labels appear at side of pages: on right if TCS_BOTTOM else at left |
|TCS_TABS|Page labels appear normally |
|TCS_BUTTONS|Page labels appear and work like buttons. Page area is usually not used. Control has no border. Do not use with TCS_SCROLLOPPOSITE |
|TCS_SINGLELINE|When widths of page labels exceed width of control, show horizontal scroll bar |
|TCS_MULTILINE|When widths of page labels exceed width of control, show multiple rows of page titles|
|TCS_RIGHTJUSTIFY|Page labels widen to occupy width of control. Requires TCS_MULTILINE |
|TCS_FIXEDWIDTH|Page labels are all the same width |
|TCS_RAGGEDRIGHT|Width of page labels depends on width of labels |
|TCS_FOCUSONBUTTONDOWN|Page receives input focus on button down. Useful with TCS_BUTTONS |
|TCS_FOCUSNEVER|Page never receives input focus |
|WS_TABSTOP|Control can be selected with Tab and S-Tab |
|WS_HSCROLL|{{KODA>VAR>WS_HSCROLL}} |
|WS_VSCROLL|{{KODA>VAR>WS_VSCROLL}} |
|WS_VISIBLE|{{KODA>VAR>WS_VISIBLE}} |
|WS_BORDER|{{KODA>VAR>WS_BORDER}} |
|WS_CLIPSIBLINGS|{{KODA>VAR>WS_CLIPSIBLINGS}} |
#remarks_header[Extra Styles:]#
|TCS_EX_FLATSEPARATORS|Shows separators between page labels. Requires TCS_BUTTONS and TCS_FLATBUTTONS |
|WS_EX_CLIENTEDGE|{{KODA>VAR>WS_EX_CLIENTEDGE}}|
|WS_EX_STATICEDGE|{{KODA>VAR>WS_EX_STATICEDGE}} |
#remarks_header[Pages:]#
Each page has its own properties:
|**Caption**|Text displayed at the top of the page|
|**Left, Top**|{{KODA>VAR>Left,Top}} |
|**Width, Height**|{{KODA>VAR>Width,Height}} |
|**Hint**|Text that appears when cursor hovers over control. Generates call to GUICtrlSetTip |
|**ImageIndex**|{{KODA>VAR>ImageIndex}} |
|**Name**|{{KODA>VAR>Name}} |
#remarks_header[Remarks:]#
* AutoIt limits the number of Tab controls on a form to one.
* Microsoft admits that Hints can behave strangely: consider a Tab control with //n// pages:
^With Hints on ^Without Hints on ^Hints show ^
|Control only |all Pages |Control's Hint on all Pages |
|Page 1 |Control, other Pages |Page 1 |
|Page //n// |Control|Page //n// Hint on Pages 1 to //n// |
|Pages 1 and //n// |Control and other Pages |Only Pages 1 and //n// have Hints |
|Control and any //Page(s)// |other Pages |on //Page(s//) - other Pages don't show Control's Hint |
This behavior is acknowledged in AutoIt; it may be due to a deficiency in Windows.
Koda partly overcomes this behavior. If a Page other than the first one specifies a Hint, Koda generates GUICtrlSetTip(-1,"") for the first page.
Koda is unable to have the Hint for the control show when any of the Pages specify a Hint.
#remarks_header[Related:]#
None