XTPWorkspaceCommand Enumeration
Description
Specifies a TabWorkspace tab grouping command. You can use these commands to create tab groups and move tabs via code.
Members
| Member | Description |
|---|---|
| XTP_ID_WORKSPACE_MOVEPREVIOUS | Used to move a TabControlItem to the previous tab group. |
| XTP_ID_WORKSPACE_MOVENEXT | Used to move a TabControlItem to the next tab group. |
| XTP_ID_WORKSPACE_NEWHORIZONTAL | Used to create a new horizontal tab group. |
| XTP_ID_WORKSPACE_NEWVERTICAL | Used to create a new vertical tab group. |
Remarks
You have the ability to group tabs vertically or horizontally within the tab workspace. Tabs can easily be moved from one group to another by drag-and-drop or via code. You can easily add functionality for the user to create a new horizontal/vertical group and move a tab to the previous/next group simply by adding a control in your Command Bar with an ID of 35002. Command Bars will automatically display the appropriate grouping controls for you. For example, if only one tab is present, no grouping controls are displayed.
Example
Enabling .NET Style Tab Grouping (Visual Basic)
This sample code illustrates how to add a tabbed workspace and enable .NET style tab grouping.
CommandBars.ShowTabWorkspace(True)
CommandBars.TabWorkspace.EnableGroups
Adding Tab Workspace Commands to the Command Bar (Visual Basic)
This sample code illustrates how to add the tab grouping controls to your command bar. You only need to add one control with the system-defined ID 35002. Command Bars will automatically add and remove the appropriate controls for you when the control is clicked.
Dim ControlWindow As CommandBarPopup
' This will add a popup menu to the active menu bar
Set ControlWindow = CommandBars.ActiveMenuBar.Controls.Add(xtpControlPopup, 0, "&Window", -1, False)
With ControlWindow.CommandBar.Controls
' This will add the MoveToNextGroup, MoveToPrevGroup, NewHorizontalGroup, and NewVerticalGroup to the
' command bar popup menu. Only the most appropriate commands will be displayed
.Add xtpControlButton, 35002, "&Workspace Actions"
' The following lines of code manually add the workspace commands, you might do this if the commands
' should always be shown.
.Add xtpControlButton, XTP_ID_WORKSPACE_NEWHORIZONTAL, "New Horizontal Tab Group"
.Add xtpControlButton, XTP_ID_WORKSPACE_NEWVERTICAL, "New Vertical Tab Group"
.Add xtpControlButton, XTP_ID_WORKSPACE_MOVEPREVIOUS, "Move to Previous Tab Group"
.Add xtpControlButton, XTP_ID_WORKSPACE_MOVENEXT, "Move to Next Tab Group"
End With
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.