constant-learner
constant-learner

Reputation: 1

Combobox with clickable items

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

Answers (2)

Ken
Ken

Reputation: 1880

Two Ideas-

  1. 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.

  2. 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

Sameh Deabes
Sameh Deabes

Reputation: 2973

you may use a hidden textbox beside the combobox, and show it only if the used selects the Custom item

Upvotes: 0

Related Questions