We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ComboBoxAdv

Hi, I have a ComboBoxAdv with "dropdown" style. If I assign a value to the ComboBoxAdv.Text property which isn't one of the dropdown-items there comes up an exception and the textbox-text is set to the first item entry. Is there any way to prevent this and have the assigned value in the textbox? What I wanna do: I use the combobox for setting up filters on tables. If I have an optionfield with the possible values "test,test2,test3" I wanna be able to set a filter on "test OR test2". That means I choose the "test" item from the dropdownbox and type in " OR " and choose "test2" from the dropdownbox. All works fine because I overwrote some methods to get this behaviour. If a filter is set and I open the form to set some other filters I initialize the combobox with the currently set filter (in this sample "test OR test2". Now the exception is thrown and the text in the combobox is set back to "test". I hope you understand what I wanna do. Is there any way to do that? Regards, Peter

1 Reply

PE Peter July 19, 2003 05:51 AM UTC

I got it: I did set the value before the form is loaded. If I set the value in the FormLoad event the combobox is initialized and the error do not occour. And I have to set the TextBox.Text and not the ComboBox.Text. Peter

Loader.
Live Chat Icon For mobile
Up arrow icon