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:
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice