Function dlgMyFunc(identifier$, action, suppvalue)
dlgMyFunc = True
Select Case action
Case 1 'Dialogbox loaded
dlgValue "chkA", 1
dlgValue "chkB", 1
dlgValue "chk1", 1
dlgValue "chk2", 1
dlgValue "chk3", 1
Case 2 'Button clicked or value changed
Select Case identifier
Case "btnUnSel","btnSelAll"
If identifier = "btnUnSel" Then
iValue = 0
Else
iValue = 1
End If
dlgValue "chkA", iValue
dlgValue "chkB", iValue
dlgValue "chk1", iValue
dlgValue "chk2", iValue
dlgValue "chk3", iValue
Case "btnOK"
dlgMyFunc = False
End Select
End Select
End Function
Sub Main
Begin Dialog dlgJunk 80, 70, "MyDialog", .dlgMyFunc
OkButton 5, 40, 20, 12, .btnOK
Button 30, 40, 20, 12, "UnSel", .btnUnSel
Button 55, 40, 20, 12, "SelAll", .btnSelAll
Checkbox 5, 5, 20, 12, "A", .chkA
Checkbox 30, 5, 20, 12, "B", .chkB
Checkbox 5, 20, 20, 12, "1", .chk1
Checkbox 30, 20, 20, 12, "2", .chk2
Checkbox 55, 20, 20, 12, "3", .chk3
End Dialog
Dim dlgVar as dlgJunk
On Error Resume Next
Dialog dlgVar
End Sub