none
ComboBox, No Change.

Answers

  • Ahh, it's that sort of change you want to prevent... in that case, set the ComboBox's DropDownStyle property to DropDownList.

    Monday, July 24, 2006 11:27 AM
  • set the selectedindex property.  Be aware that this will fire the selectedIndexChanged event. 
    Monday, July 24, 2006 1:17 PM
  • Hi,

    If you're worried about the SelectedIndexChanged event handler firing, you can use the RemoveHandler expression then change the Index, then use AddHandler to put it back.  I was required to do that when i was experimenting with Cascading Drop Downs in my App, otherwise i had a stack overflow because each time i added something to the combo box, it fired the SelectedIndexChanged event, odd but true

    Chris

    Monday, July 24, 2006 6:57 PM

All replies

  • You can Disable it by setting it's Enabled property to False.

    Sunday, July 23, 2006 8:42 PM
  • Thanks Brendan,
    I already knew that, but it's not what I want.
    I need the user to be able to select the items in the combobox, I don't want them to be able to write text in to it.
    Monday, July 24, 2006 11:17 AM
  • Ahh, it's that sort of change you want to prevent... in that case, set the ComboBox's DropDownStyle property to DropDownList.

    Monday, July 24, 2006 11:27 AM
  • That's it Brendan!

    Now, how do I get a value to show in the combobox when the form first starts up? at the moment it's blank.
    This is the last query on this thread.

    Cheers
    Graham
    Monday, July 24, 2006 1:07 PM
  • set the selectedindex property.  Be aware that this will fire the selectedIndexChanged event. 
    Monday, July 24, 2006 1:17 PM
  • Hi,

    If you're worried about the SelectedIndexChanged event handler firing, you can use the RemoveHandler expression then change the Index, then use AddHandler to put it back.  I was required to do that when i was experimenting with Cascading Drop Downs in my App, otherwise i had a stack overflow because each time i added something to the combo box, it fired the SelectedIndexChanged event, odd but true

    Chris

    Monday, July 24, 2006 6:57 PM
  • Thanks to all who offered Help and Advice.
    Monday, July 24, 2006 10:52 PM
  • Okay how do you change the DropDownStyle property... I cant seem to find it...

    Thanks
    Friday, July 28, 2006 6:56 PM
  • It's in the Properties window of the ComboBox.
    Friday, July 28, 2006 9:02 PM
  • I was just about to say the same.
    Friday, July 28, 2006 9:03 PM
  • I see, In VBA for Excel its:

       combobox1.Style  = fmStyleDropDownList
    Saturday, July 29, 2006 10:57 AM