Hello guys,
I'm stuck with adding a Run command with each Label in the ListofStates list.
For example:
- When open dropdownlist, I choose Alabama - AL, it will run a page with Alabama info.
- When I choose California - CA from the DropDownList, it will run a page with California - Info
etc.
I want to add each page for each state in the list but I don't know how and couldn't find anything online.
Please help!
Here is my Gui code:
#SingleInstance, Force
ListofStates:="ALABAMA - AL|ALASKA - AK|ARIZONA - AZ|ARKANSAS - AR|CALIFORNIA - CA|COLORADO - CO|CONNECTICUT - CT|DELAWARE - DE|DISTRICT OF COLUMBIA - DC|FLORIDA - FL|GEORGIA - GA|GUAM - GU|HAWAII - HI|IDAHO - ID|ILLINOIS - IL|INDIANA - IN|IOWA - IA|KANSAS - KS|KENTUCKY - KY|LOUISIANA - LA|MAINE - ME|MARYLAND - MD|MASSACHUSETTS - MA|MICHIGAN - MI|MINNESOTA - MN|MISSISSIPPI - MS|MISSOURI - MO|MONTANA - MT|NEBRASKA - NE|NEVADA - NV|NEW HAMPSHIRE - NH|NEW JERSEY - NJ|NEW MEXICO - NM|NEW YORK - NY|NORTH CAROLINA - NC|NORTH DAKOTA - ND|OHIO - OH|OKLAHOMA - OK|OREGON - OR|PENNSYLVANIA - PA|PUERTO RICO - PR|RHODE ISLAND - RI|SOUTH CAROLINA - SC|SOUTH DAKOTA - SD|TENNESSEE - TN|TEXAS - TX|UTAH - UT|VERMONT - VT|VIRGIN ISLANDS - VI|VIRGINIA - VA|WASHINGTON - WA|WEST VIRGINIA - WV|WISCONSIN - WI|WYOMING - WY|"
Gui, +AlwaysOnTop
Gui, +Resize
Gui, Color, White
Gui, Show, x1100 y30 w500 h500, States Info
Gui, Font, cBlack
Gui, Add, Text, x10 y10, States Information
Gui, Add, Button, x63 y30 gC_Db_History, DB History
Gui, Add, Button, x123 y30 gC_Db_Population, DB State Population
Gui, Add, Button, x201 y30 gC_Db_Place_To_Visit, DB Place to Go
Gui, Add, DropDownList, xm w200 h40 vStates +R50,% ListofStates
return
C_Db_History:
Run, https://www.50states.com/, Maximize
return
C_Db_Population:
Run, http://www.enchantedlearning.com/usa/st ... tion.shtml, Maximize
return
Db_Place_To_Visit:
Run, Chttp://www.travelchannel.com/destinations/us/p ... -landmarks, Maximize
return
ESC::ExitApp
return
Gui DropDownList help, Add Run to specific Labels
Re: Gui DropDownList help, Add Run to specific Labels
Code: Select all
Run, Chttp://www.travelchannel.com/destinations/us/photos/50-states-50-landmarks, Maximize
- divanebaba
- Posts: 806
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: Gui DropDownList help, Add Run to specific Labels
You could make a list with states and websites together. With parsing this list, you can get the list for your DDL.Your DDL needs a gLabel:Then, after choosing your state with the DDL, you have to parse again to find the state you have choosen with your DDL.This is a possible way.
Code: Select all
ListOfAll =
( Join`n
ALABAMA - AL,https://autohotkey.com/boards/viewtopic.php?p=150128#p150128
ALASKA - AK,https://de.wikipedia.org/wiki/Lehrerempfehlung
)
Loop, parse, ListOfAll, `n, `r
{
Stringsplit, a_, A_LoopField, `,
ListofStates = %ListofStates%%a_1%|
}
StringTrimRight, ListofStates, ListofStates, 1
msgbox % ListofStates
Code: Select all
Gui, Add, DropDownList, xm w200 h40 vStates +R50 gStatesLabel,% ListofStates
Code: Select all
StatesLabel:
GuiControlGet, myStates,, States
Loop, parse, ListOfAll, `n, `r
{
ifinstring, A_LoopField, %myStates%
...
}
return
Einfach nur ein toller Typ.
Re: Gui DropDownList help, Add Run to specific Labels
divanebaba wrote:You could make a list with states and websites together. With parsing this list, you can get the list for your DDL.
Warum dann nicht gleich ein array?
Your DDL needs a gLabel
Nicht zwingend. Denn der variableninhalt der DDL ist auch ohne eigene sprungmarke abfragbar.
Then, after choosing your state with the DDL, you have to parse again to find the state you have choosen with your DDL.
Nö. Die variable 'States' sollte doch bereits den ausgewählten eintrag enthalten
- divanebaba
- Posts: 806
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: Gui DropDownList help, Add Run to specific Labels
Blue font -> BoBo [Translation into english by divanebaba - Google Translator]divanebaba wrote:BoBo wrote:divanebaba wrote:... gähn ...BoBo wrote:divanebaba wrote:You could make a list with states and websites together. With parsing this list, you can get the list for your DDL.
Warum dann nicht gleich ein array?
[Why not an array right away?]
Wer bei einer solchen Aufgabenstellung ins Schleudern gerät, wird bei Arrays bestimmt umfallen.
[Whoever gets into a spin with such a task will definitely fall over with arrays.]
Your DDL needs a gLabel
Nicht zwingend. Denn der variableninhalt der DDL ist auch ohne eigene sprungmarke abfragbar.
[Not necessarily. Because the variable contents of the DDL can also be queried without its own jump mark.]
Aber zwingend nach der Aufgabenstellung: "When open dropdownlist, I choose Alabama - AL, it will run a page with Alabama info"
[But mandatory according to the task: "When open dropdownlist, I choose Alabama - AL, it will run a page with Alabama info"]
Then, after choosing your state with the DDL, you have to parse again to find the state you have choosen with your DDL.
Nö. Die variable 'States' sollte doch bereits den ausgewählten eintrag enthalten
[Nope. The variable 'States' should already contain the selected entry.]
Sie ist aber nicht enthalten. Jetzt komme ich mir vor wie ein AUDI-Manager. Die Physik sagt, es geht nicht, der Vorgesetzte will (kann) davon nichts wissen.
[It is not included. Now I feel like an AUDI manager. Physics says it can not be done, the supervisor does not want to know (better: isn't able not know) about it.]
Black and green ->
Einfach nur ein toller Typ.