Syntax
| Function dialogfunc(DlgItem$, Action%, SuppValue%) _
As Boolean
Select Case Action%
Case 1 ' Dialog box initialization
...
Case 2 ' Value changing or button pressed
...
Case 3 ' TextBox or ComboBox text changed
...
Case 4 ' Focus changed
...
Case 5 ' Idle
...
Case 6 ' Function key
...
End Select
End Function
| ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description
| A dialogfunc implements the dynamic dialog capabilities.
| ||||||||||||||||||||||
See Also
| |||||||||||||||||||||||
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,"&Hello"
End Dialog
Dim dlg As UserDialog
Debug.Print Dialog(dlg)
End Sub
Function DialogFunc%(DlgItem$, Action%, SuppValue%)
Debug.Print "Action=";Action%
Debug.Print DlgItem$;"=""";DlgText$(DlgItem$);""""
Debug.Print "SuppValue=";SuppValue%
Select Case Action%
Case 1 ' Dialog box initialization
Beep
Case 2 ' Value changing or button pressed
If DlgItem$ = "Hello" Then
MsgBox "Hello"
DialogFunc% = True 'do not exit the dialog
End If
Case 4 ' Focus changed
Debug.Print "DlgFocus=""";DlgFocus();""""
Case 6 ' Function key
If SuppValue And &H100 Then Debug.Print "Shift-";
If SuppValue And &H200 Then Debug.Print "Ctrl-";
If SuppValue And &H400 Then Debug.Print "Alt-";
Debug.Print "F" & (SuppValue And &HFF)
End Select
End Function
|