DlgEnable “ControlName”, Value
This statement is used to enable or disable a particular control on a dialog box.
The parameter ControlName is the name of the control on the dialog box.
The parameter Value is the value to set it to. 1 = Enable, 0 = Disable. On is equal to 1 in the example below. If the second parameter is omitted the status of the control toggles.
Begin Dialog UserDialog2 160,160, 260, 188, "3", .DlgFunc Text 8,10,73,13, "New dialog Label:" TextBox 8, 26, 160, 18, .FText CheckBox 8, 56, 203, 16, "New CheckBox",. ch1 CheckBox 18,100,189,16, "Additional CheckBox", .ch2 PushButton 18, 118, 159, 16, "Push Button", .but1 OKButton 177, 8, 58, 21 CancelButton 177, 32, 58, 21 End Dialog Dim Dlg2 As UserDialog2 Dlg2.FText = "Your default string goes here" Function DlgFunc( ControlID$, Action%, SuppValue% ) Select Case Action% Case 1 DlgEnable "Group", 0 DlgVisible "Chk2", 0 DlgVisible "History", 0 Case 2 If ControlID$ = "Chk1" Then DlgEnable "Group", On DlgVisible "Chk2" DlgVisible "History" End If If ControlID$ = "Chk2" Then DlgText "History", "Push to display nested dialog" End If If ControlID$ = "History" Then DlgEnable=1 Number = 4 MsgBox SQR(Number) & " The sqr of 4 is 2" x = Dialog( Dlg2 ) End If If ControlID$ = "but1" Then End If Case Else End Select Enable =1 End Function