ComboBox text input

Discussion in 'Questions (Windows Mobile)' started by mwaite, Jun 7, 2007.

  1. mwaite

    mwaite Member Licensed User

    B4PPC Help states "ComboBox does not support the Text property and the user cannot write anything inside a ComboBox".

    I wish this were true. I can overwrite any selected item in the combobox with other text. Then when I try to read the combobox, eg. combo1.Item(combo1.SelectedIndex), I get an error about a bad Index -1 value.

    So it appears I need to handle and dispose of the user entered text in the combobox.

    I'm not sure of the best way to handle this situation. Anyone have a suggestion??
     
  2. mwaite

    mwaite Member Licensed User

    Figured it out

    Well after I thought about it some more, I figured it out...

    Sub combo1_LostFocus
    If combo1.SelectedIndex = -1 then combo1.SelectedIndex = 0
    End Sub

    Wasn't as difficult as I was making it out to be. Guess I was just surprised that you could enter text at all when the Help said "user cannot write ..." (should be "user should not write...") :cool:
     
Loading...