9.0
142
shift/control/alt key state.
Regular function keys range from 1 to 24.
Shift function keys have &H100 added.
Control function keys have &H200 added.
Alt function keys have &H400 added.
(Alt-F4 closes the dialog and is never passed to the Dialog Function.)
See Also: Begin Dialog.
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
C:\ABCTemp\vbs\Function_Definition.htm
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
Dialog Instruction/Function
Syntax
Dialog dialogvar[, default]
-or-
Dialog(dialogvar
[, default])
Group
User Input










