Description
Add an entry for the switch value.
Syntax
object.AddSwitch(strLabel, strV0, intIdx) |
object
Required. Object name, returned by set Dim idlg As InputDlg = New InputDlg.
strLabel
Label as it appears in the dialog.
strV0
String to display after check-box
intIdx
Value of switch: can be True or False.
Example
Switch with default value of Yes:
Dim idlg As InputDlg = New InputDlg
idlg.Title = "My title"
Dim iNum = idlg.AddSwitch("My switch", "", True) ' add check box field, label = "My Switch", initial value = checked
' and return the field index in iNum variable
If idlg.ShowDialog Then ' if OK was clicked...
dim bVal = CBool(idlg.GetItemValue(iNum))) ' return the Boolean value of field with index iNum
End If
See also