I would like to get the item index of a string located in a comboBox.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • GeorgioBuzz
    New Member
    • Jan 2010
    • 1

    I would like to get the item index of a string located in a comboBox.

    I write this code :

    MyCombo.Selecte dIndex = MyCombo.Items.I ndexOf ("MyString")

    this line return -1 as the index value ( it means MyString is not found)

    "MyString" exists in the items list. MyCombo is filled with the following code :

    MyCombo.DataSou rce = MyDataSet.table s
    MyCombo.Display Member = "...."
    MyCombo.ValueMe mber = "...."

    thanks
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    "MyString" is a char string. Do you need a wide-char string instead?

    Comment

    Working...