HideFlags Property
See Also
Description
Retrieves the HideFlags of the control.
Property type
Read-write property
Syntax (Visual Basic)
Public Property HideFlags() As XTPControlHideFlags
(See: XTPControlHideFlags enumeration)
Remarks
HideFlags indicates how a control was hidden (if it is hidden) or why it is not visible. Most of these flags are read-only and should not be set by the developer.
There is one situation where you may set a flag manually: xtpHideCustomize. Set this flag when you want the control to be initially hidden but still appear in the Add and Remove Buttons popup of the toolbar. When set, the control appears in the Add and Remove Buttons popup without a check mark (indicating it is currently hidden). This flag is automatically set when a command is hidden via customization.
Hide flag values
| Value | Flag | Meaning / Reason |
|---|---|---|
| 0 | xtpNoHide | Control is currently visible. |
| 1 | xtpHideGeneric | Developer set (for example, Visible = False). |
| 2 | xtpHideWrap | Toolbar is too small and the control is wrapped. |
| 4 | xtpHideDockingPosition | If a toolbar has a ComboBox or Edit control and the toolbar is docked to the left or right side of the frame, these controls become hidden. |
| 8 | xtpHideScroll | There are too many controls in a popup and the control is hidden because the popup is scrolled. |
| 16 | xtpHideCustomize | User removed it via the Add and Remove Buttons popup (customization must be enabled). This flag can be set manually to make the control initially hidden but still available in the customize popup. |
| 32 | xtpHideExpand | The control is a "hidden command" and the Intelligent Menus option is on; the command is hidden until the menu is fully shown. |
(See also: Enable customization, AddHiddenCommand, AlwaysShowFullMenus)
Example
HideFlags Sample (Visual Basic)
This sample illustrates how to use HideFlags to determine why a control was hidden.
Private Sub cmdFindHiddenButton_Click(Index As Integer)
Dim Control As CommandBarControl
' Find the Print control
Set Control = CommandBars.FindControl(, ID_FILE_PRINT)
' If found, execute Select statement
If Not Control Is Nothing Then
' Determine why the Print button is hidden
Select Case Control.HideFlags
' Developer has hidden control with Visible = False
Case xtpHideGeneric
MsgBox "You have hidden the Print button with Visible = False.", vbInformation, "Button Hidden"
' Toolbar docking position has hidden control
Case xtpHideDockingPosition
MsgBox "You need to dock your toolbar to the top or bottom to see ComboBox or Edit controls.", vbInformation, "Button Hidden"
' User has hidden control via customize
Case xtpHideCustomize
MsgBox "You need to replace the Print button to print.", vbInformation, "Button Hidden"
' Control is hidden because it is a hidden command (intelligent menus)
Case xtpHideExpand
MsgBox "You rarely use this command, so it is currently hidden until the menu is fully shown.", vbInformation, "Button Hidden"
' Control is hidden because it is scrolled
Case xtpHideScroll
MsgBox "You need to scroll the popup menu to find the Print button.", vbInformation, "Button Hidden"
' Control hidden because of toolbar wrap
Case xtpHideWrap
MsgBox "You need to expand the toolbar to use the Print Button.", vbInformation, "Button Hidden"
' Control is not hidden
Case xtpNoHide
MsgBox "Your button is not hidden.", vbInformation, "Button Visible"
End Select
End If
End Sub
See Also
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.