I have a dropdown button with all 50 states (ie. Minnesota, Wisconsin, etc). How to I point to the correct state in the dropdown button based on the value of a variable where the variable has a specific state in it.
Warren
Dropdown Button
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Hi warrenk, I had a brief scout around the Dictionary but personally couldn't find a way to get a particular line of a dropdown menu to highlight itself using mouseDown (rather than MenuPick, as stuff within a MenuPick handler obviously wouldn't happen until you picked (clicked) a menu item, which is not what you want to do); maybe there is a way somewhere...
Another way that seems to promise more success would be to make your menu from a stack menu. Haven't investigated stack menus much but seem to remember Mark having a neat stack on his RevOnline page, if you're unfamiliar with this. This way you'll have an easier time telling a particular button (menu item) to hilight based on your variable at the time...haven't done any tests on that but fairly certain that'll be the direction to go...

Another way that seems to promise more success would be to make your menu from a stack menu. Haven't investigated stack menus much but seem to remember Mark having a neat stack on his RevOnline page, if you're unfamiliar with this. This way you'll have an easier time telling a particular button (menu item) to hilight based on your variable at the time...haven't done any tests on that but fairly certain that'll be the direction to go...

How about
does that work? If not, what circumstances are you trying to do this in?
Code: Select all
set the label of button "btnDropDown" to (tVariable)
Or (just had another thought): if I understand you correctly, when the user clicks on the pulldown menu, you want the menu list to appear as usual but a particular menu item already highlighted for them, based on your variable. Presumably then, the user goes to that highighted menu item to select it.
If this is correct, could I suggest that you don't need a pullDown menu at all? Why not put your variable name into a button or a field made to look like a button; or into a field with a small "go" button beside it; they'd be a bit more scripting involved, telling the field or button what to do when it's pressed, depending on which variable is in use, but this way, at least, would be more straightforward and less "work" for your user.

If this is correct, could I suggest that you don't need a pullDown menu at all? Why not put your variable name into a button or a field made to look like a button; or into a field with a small "go" button beside it; they'd be a bit more scripting involved, telling the field or button what to do when it's pressed, depending on which variable is in use, but this way, at least, would be more straightforward and less "work" for your user.
