combobox - vb.net - set default value to show in dropdown when loaded

34398
12
Jump to solution
01-03-2013 04:53 AM
maxsteinbrenner
New Contributor II
so i have a add-in combobox and would like it to have the text "select storm" in the (currently blank) dropdown when the combo box is displayed. is this possible?

thanks!

max
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor
Not a dumb question at all, especially since I gave you an incorrect answer the first time.

In the Config.esriaddinx file, if you add a space to the Combobox line, you should get Intellisense to pop up, showing the possible tags you can add. Use hintText. The sample Custom Selection Extension shows this and other tags that you can use.

View solution in original post

12 Replies
KenBuja
MVP Esteemed Contributor
You can set the combobox's text property to "Select storm". Once something is selected, that text will not show up again.
0 Kudos
maxsteinbrenner
New Contributor II
You can set the combobox's text property to "Select storm". Once something is selected, that text will not show up again.



probably a dumb question but:

where would/how i access the text property of the combobox? i would know how to do it if i made the combobox in the designer but this one is an add-in and i am unfamiliar with how to access it's properties.

thanks,

max
0 Kudos
KenBuja
MVP Esteemed Contributor
Not a dumb question at all, especially since I gave you an incorrect answer the first time.

In the Config.esriaddinx file, if you add a space to the Combobox line, you should get Intellisense to pop up, showing the possible tags you can add. Use hintText. The sample Custom Selection Extension shows this and other tags that you can use.
maxsteinbrenner
New Contributor II
Kevin,

awesome!

that is exactly what i was looking for, thanks so much.

max
0 Kudos
KenBuja
MVP Esteemed Contributor
Glad to help. Please remember to click the check on the post to signify the question was answered.
0 Kudos
NeedHelp
New Contributor
What is the best way to either:
a.) have the default text re-appear after a combo item has been selected OR
b.) have the combo box value default to the first item in it's list??
0 Kudos
KenBuja
MVP Esteemed Contributor
You can set the combobox to the first item in the list this way


myComboBox.SelectedIndex = 0
NeedHelp
New Contributor
I don't see the .SelectedIndex as an option like I do with a 'normal combo box'.
All the interaction I have with the combo box add-in is done via the "me." command.
I can do me.add or me.remove to adjust combo box items, but definitely don't have the full list of options I'm used to working with combo boxes.
0 Kudos
lethalmark
New Contributor
see more about...   vb.net combobox databinding

marc
0 Kudos