AddSwitch Method

Build 1501 on 14/Nov/2017  This topic last edited on: 12/Oct/2016, at 10:32

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

AddDateTime, AddInt, AddString, AddCombo, ComboAddItem

GetComboIdx