NSearch Posted January 9, 2006 Share Posted January 9, 2006 I have a GUI which allows the user to choose what state they want, but I would like them to be able to use just the keyboard to select the variable, instead of clicking on the combo box value. This is what I am currently using: $Label_15 = GuiCtrlCreateLabel("State:", 30, 380, 140, 20) $state = GuiCtrlCreateCombo("", 30, 400, 80, 21) GUICtrlSetData(-1,"Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|District of Columbia|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine |Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming","") What I am hoping for is when the user tabs to the combo box, they can hit the i key and it jumps to Idaho, hit i again and it jumps to Illinois....etc. Thanks. Link to comment Share on other sites More sharing options...
CyberSlug Posted January 9, 2006 Share Posted January 9, 2006 #include <GuiConstants.au3> GuiCreate("foo", 800, 600) $Label_15 = GuiCtrlCreateLabel("State:", 30, 380, 140, 20) ; IMPORANT: Height of box is height of the drop down list on Windows XP $state = GuiCtrlCreateCombo("", 30, 400, 80, 199, $CBS_DROPDOWNLIST) GUICtrlSetData(-1,"Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|District of Columbia|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine |Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming","Alabama") GuiSetState() While GuiGetMsg() <> $GUI_EVENT_CLOSE Wend Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
ChrisL Posted January 9, 2006 Share Posted January 9, 2006 (edited) $state = GuiCtrlCreateCombo("", 30, 400, 80, 21, $CBS_AUTOHSCROLL + $WS_VSCROLL + $CBS_DROPDOWNLIST ) Edit.. Bugger too slow! Edited January 9, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
NSearch Posted January 9, 2006 Author Share Posted January 9, 2006 Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now