|
A collection of DtoSelectionItem objects representing the possible values of a selection type setting.
|
Count
|
Returns the number of members in a collection.
|
|
Item
|
Returns a specific member of a collection.
|
The property AllPossibleSelections of object DtoSetting Object returns the DtoSelectionItems collection.
Use the Count property to find the number of members in the collection.
Set first_setting = my_settings(1) type = first_setting.Type ' only call this for selection type settings ' see Setting Type enumeration ' for a list of setting types if (type = dtoSingleSel) OR (type = dtoMultiSel) Set all_the_selections = first_setting.AllPossibleSelections
DtoCategories Collection
DtoSetting Object
Add an item to a DtoSelectionItems collection.
|
Collection
|
DtoSelectionItems Collection to which to add object.
|
|
Object
|
A DtoSelectionItem object that you want to add.
|
|
result
|
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
|
This method takes a parameter of type DtoSelectionItem. Therefore, you are responsible for first instantiating the object and setting its properties before adding it to the collection.
Dim Result As dtoResult Dim Session As New DtoSession Result = Session.Connect("nik-ntws", "", "") Dim my_setting As DtoSetting Dim SetID As Long SetID = 26 Set my_setting = Session.GetSetting(SetID) If my_setting Is Nothing Then MsgBox " Setting is wrong" Exit Sub End If ' Start to assign new values: Dim new_selections As New DtoSelectionItems 'Add Items with ItemID 1,2 and 12 new_selections.Add my_setting.AllPossibleSelections.Item(2) 'Microsoft SPXII new_selections.Add my_setting.AllPossibleSelections.Item(4) 'Microsoft IPX new_selections.Add my_setting.AllPossibleSelections.Item(12) 'Microsoft NETBIOS my_setting.Value = new_selections
Returns a DtoSelectionItem object from a DtoSelectionItems collection given an id.
|
my_selection_item
|
DtoSelectionItem Object corresponding to id.
|
Dim Result As DtoResult Dim Session As New DtoSession Result = Session.Connect("nik-ntws", "", "") Dim my_setting As DtoSetting Dim SetID As Long SetID = 26 Set my_setting = Session.GetSetting(SetID) If my_setting Is Nothing Then MsgBox " Setting is wrong" Exit Sub End If Dim new_selections As New DtoSelectionItems new_selections.Add my_setting.AllPossibleSelections.GetByID(1) 'Microsoft SPXII new_selections.Add my_setting.AllPossibleSelections.GetByID(3) 'Microsoft TCP/IP new_selections.Add my_setting.AllPossibleSelections.GetByID(11) 'Microsoft NETBIOS my_setting.Value = new_selections
Removes an item from a DtoSelectionItems collection
|
Collection
|
DtoSelectionItems collection
|
|
item
|
Variant that can contain the index (starting with 1) of the item you wish to remove from the collection or the name of the selection item.
|
|
result
|
DtoResult long value indicating the result of the method call. Use the Error property of the DtoSession Object to obtain a description for the result.
|
This method takes a parameter of type DtoSelectionItem
Dim Result As DtoResult Dim Session As New DtoSession Result = Session.Connect("nik-ntws", "", "") Dim my_setting As DtoSetting Dim SetID As Long SetID = 26 Set my_setting = Session.GetSetting(SetID) If my_setting Is Nothing Then MsgBox " Setting is wrong" Exit Sub End If Dim new_selections As New DtoSelectionItems new_selections.Add my_setting.AllPossibleSelections.GetByID(1) 'Microsoft SPXII new_selections.Remove(1) my_setting.Value = new_selections
|
Chapter contents
Prev topic: DtoSetting Object
|