Reputation: 1
Good day S-O
Need help in developing a Custom combobox. I should be able to display items like
10
20
30
Custom...
whenever i click Item 'x' i should get a pop up window to enter some value
My question is ...Is it a good idea to display an additional windows form with just a textbox control in it or is there any other better approach in such scenarios ?
Upvotes: 0
Views: 340
Reputation: 1880
Two Ideas-
As @Marcel stated in his comment, you can use a ComboBox with its DropDownStyle set to DropDown (not DropDownList). This will allow a user to select from the list or enter their own value. From there, you can do validation of the value if necessary.
If you need to be more explicit about a custom option (as opposed to the first idea, where it is not entirely obvious that you can enter a custom value), you could have a ComboBox with DropDownStyle set to DropDownList, a TextBox below it, and two RadioButtons that will enable/disable these to make them mutually exclusive.
I err against using popup messages/form whenever possible. I think it makes the application look kind of hacky, IMHO.
Upvotes: 1
Reputation: 2973
you may use a hidden textbox beside the combobox, and show it only if the used selects the Custom item
Upvotes: 0