PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Overview
  • Naming tab panes
  • Handling a tab pane
  • Changing the active tab pane
  • Remarks
  • Finding out the active tab pane
  • Tab number
  • Tab caption
  • WLanguage functions used to handle tabs
  • Properties specific to the Tab controls
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Handling a Tab control by programming
Overview
WINDEV, WINDEV Mobile and WEBDEV allow you to handle a Tab control by programming. To do so, use the variable of the Tab control in the code.
The variable of the Tab control corresponds to the number of the active pane. This variable is an integer. This number is assigned in the tab description: in the list of tabs, the first tab is tab #1, the second tab is tab #2, ...
Versions 26 and later
You can also name the tab panes (in the "General" tab of the control description window). In this case, you can directly enter the tab name to manipulate it.
New in version 26
You can also name the tab panes (in the "General" tab of the control description window). In this case, you can directly enter the tab name to manipulate it.
You can also name the tab panes (in the "General" tab of the control description window). In this case, you can directly enter the tab name to manipulate it.
Remark: Going from a tab to another one (when the user clicks a tab) is automatically managed.
WEBDEV - Server code The different codes for handling the Tab controls are server codes.
Versions 26 and later
Naming tab panes
From version 26, you can name tab panes. These (optional) names make it easier to manipulate tabs in the code. Unnamed tabs are handled via their index. If the index changes (when a tab is moved, inserted, etc.), all the WLanguage code must be revised to take this change into account.
Naming tabs makes these operations easier: the name of the tab pane is specified in the "General" tab of the control description window. It can then be used in the code to designate the pane to handle. You can move or insert tabs without having to check all the existing code.
New in version 26
Naming tab panes
From version 26, you can name tab panes. These (optional) names make it easier to manipulate tabs in the code. Unnamed tabs are handled via their index. If the index changes (when a tab is moved, inserted, etc.), all the WLanguage code must be revised to take this change into account.
Naming tabs makes these operations easier: the name of the tab pane is specified in the "General" tab of the control description window. It can then be used in the code to designate the pane to handle. You can move or insert tabs without having to check all the existing code.
Naming tab panes
From version 26, you can name tab panes. These (optional) names make it easier to manipulate tabs in the code. Unnamed tabs are handled via their index. If the index changes (when a tab is moved, inserted, etc.), all the WLanguage code must be revised to take this change into account.
Naming tabs makes these operations easier: the name of the tab pane is specified in the "General" tab of the control description window. It can then be used in the code to designate the pane to handle. You can move or insert tabs without having to check all the existing code.
Handling a tab pane
To handle a tab pane via WLanguage properties, use the following syntax:
  • Unnamed tab pane: the tab pane is identified by its number. The number is assigned in the tab description: in the list of tabs, the first tab is tab #1, the second tab is tab #2, ...
    Name_Tab_Control[Number_Of_Tab_Pane].PropertyName = PropertyValue

    For example:
    TAB_MyTab[2].State = Grayed
  • Versions 26 and later
    Named tab pane: The tab pane is identified by the name specified in the "General" tab of the control description window.
    Name_Tab_Pane.PropertyName = PropertyValue

    For example, if the tab pane is named "Search":
    Search.State = Grayed
    New in version 26
    Named tab pane: The tab pane is identified by the name specified in the "General" tab of the control description window.
    Name_Tab_Pane.PropertyName = PropertyValue

    For example, if the tab pane is named "Search":
    Search.State = Grayed
    Named tab pane: The tab pane is identified by the name specified in the "General" tab of the control description window.
    Name_Tab_Pane.PropertyName = PropertyValue

    For example, if the tab pane is named "Search":
    Search.State = Grayed
Remark: To use properties on a control, you can use <Control name>.PropertyName or <Control name>..PropertyName.
Changing the active tab pane
The tab pane #1 (the most on the left) is enabled by default. The current tab can be changed by programming.
To enable a tab pane:
  • Unnamed tab pane: Assign the tab with the number of the tab pane to enable:
    Name_Tab_Control = Number_Of_Tab_Pane
  • Versions 26 and later
    Named tab pane: Assign the name of the tab pane to be enabled to the Tab control:
    Name_Tab_Control = Tab_Pane_Name
    New in version 26
    Named tab pane: Assign the name of the tab pane to be enabled to the Tab control:
    Name_Tab_Control = Tab_Pane_Name
    Named tab pane: Assign the name of the tab pane to be enabled to the Tab control:
    Name_Tab_Control = Tab_Pane_Name
  • Use the Value property.

Remarks

  • If the specified tab does not exist, the displayed tab is not modified.
  • A single tab pane can be displayed at a time on the same tab.
  • When changing tab pane:
    • the exit code of the control with focus is run.
    • the entry code of first editable control in the tab pane is enabled.
Finding out the active tab pane

Tab number

To get the number of the active tab:
  • perform a simple assignment. For example:
    NumActivePane = NameTabControl
  • use the Value property.
WINDEVWindowsUniversal Windows 10 AppWindows MobileAndroidiPhone/iPadJavaPHP

Tab caption

To get the text of the active tab, simply use the Caption property on the tab pane:
For example:
  • unnamed tab:
    Trace(TAB_Tab1[TAB_Tab1]..Caption)
  • unnamed tab:
    Trace(Search.Caption)
The Caption property can also be used to change the text of the tab pane.
WLanguage functions used to handle tabs
The following functions are used to manage the characteristics of a Tab control by programming.
ControlCloneClone a tab pane.
EnumControlEnumerate the controls associated with a tab.
EnumSubElementEnumerate the panes of a tab.
ControlTabFind out the name of the Tab control associated with a control.
Properties specific to the Tab controls
The following properties are used to manage the characteristics of a Tab control by programming.
ImageUsed to find out and modify the image associated with a tab pane or with a tab.
To handle the tab pane, use the following syntax: <Tab control> [<Pane subscript>].
CountUsed to find out the number of panes in a tab.


To find out the entire list of WLanguage properties that can be used with a Tab control, see Properties associated with a Tab control.
See also
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment