DlgVisible Instruction/Function
Syntax
DlgVisible DlgItem[, Visible] -or- DlgVisible(DlgItem)
Group
Description
Instruction - Show or hide DlgItem.
Function - Return True if DlgItem is visible.
This instruction/function must be called directly or indirectly from a dialogfunc.
Parameters
| Parameters | Description |
|---|---|
| DlgItem | If this is a numeric value, it is the dialog item number. The first item is 0, second is 1, and so on. If this is a string value, it is the dialog item field name. |
| Enable | If this numeric value is True, show DlgItem. Otherwise, hide it. If this omitted, toggle it. |
Example
Sub Main Begin Dialog UserDialog 200,120,.DialogFunc Text 10,10,180,15,"Please push the OK button" TextBox 10,40,180,15,.Text OKButton 30,90,60,20 PushButton 110,90,60,20,"&Hide" End Dialog Dim dlg As UserDialog Debug.Print Dialog(dlg) End Sub Function DialogFunc(DlgItem$, Action%, SuppValue?) As Boolean Debug.Print "Action="; Action% Select Case Action% Case 1 ' Dialog box initialization Beep Case 2 ' Value changing or button pressed Select Case DlgItem$ Case "Hide" DlgText DlgItem$,"&Show" DlgVisible "Text",False DialogFunc = True 'do not exit the dialog Case "Show" DlgText DlgItem$,"&Hide" DlgVisible "Text",True DialogFunc = True 'do not exit the dialog End Select End Select End Function