GetComboStr Method

Build 1501 on 14/Nov/2017  This topic last edited on: 22/Mar/2016, at 17:09

Description

Returns the name of the item, selected in a combo box.

Note: in combo.AddItem("Above", 456), name is "Above", index is 0, and data is 456.

Syntax

retvalue = object.GetComboStr (iIdx)

object

Required. Object name, returned by Dim idlg As InputDlg = New InputDlg.

Idx

Index of the item.

Example

In this example, the message box displays the value of the combo entry, the idx of the selected item and the string of that combo entry, when you clicked Ok or pressed Return. The first item is 0, the second item is 1 and so on.

Dim idlg As InputDlg = New InputDlg

idlg.Title = "My title"

 

Dim combo As InputDlg.Combo = New InputDlg.Combo

combo.AddItem("Above", 456)

combo.AddItem("Below", 789)

Dim po = idlg.AddCombo("Position", combo, combo.ToIdx(789))

If idlg.ShowDialog Then                            ' if OK was clicked...

  MsgBox(idlg.GetComboData(po) & vbCr & _

         idlg.GetComboIdx(po) & vbCr & _

         idlg.GetComboStr(po))                 ' return the value of field with index iNum

End If

See also

GetComboIdx, GetComboData

AddCombo