Jump to content
Sign in to follow this  
DaXman

How do I choose a selection and auto execute from a combo box?

Recommended Posts

DaXman

I'd like to know how to write an if,then statement that allows me to make a choice in a combo box and have it execute the choice after selection. I have included my coding that is obviously not done but my primary problem is with $combo11. I would appreciate any help on this one. ~Thx in advance! PS please do not forget to see the Func command at the bottom of the code.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=f:\autoit3\overnight power tool.kxf
$Form1_1 = GUICreate("Overnight Tool", 1074, 772, 190, 125)
GUISetFont(8, 400, 0, "Calibri")
GUISetBkColor(0x99B4D1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1_1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1_1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1_1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1_1Restore")
$PageControl1 = GUICtrlCreateTab(0, 560, 1068, 208)
GUICtrlSetOnEvent(-1, "PageControl1Change")
$TabSheet1 = GUICtrlCreateTabItem("Scheduled Outages")
$Outages = GUICtrlCreateLabel("Scheduled Outages", 12, 593, 156, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "OutagesClick")
$Button1 = GUICtrlCreateButton("Remedy Outage Calendar", 12, 625, 155, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("TCCB Weekly Report", 172, 625, 155, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button2Click")
$Button3 = GUICtrlCreateButton("Svc Mgmt SWA Calendar", 332, 625, 155, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button3Click")
$Button4 = GUICtrlCreateButton("MR PPI's", 492, 625, 155, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button4Click")
$TabSheet2 = GUICtrlCreateTabItem("IDMN PreHires")
$Label1 = GUICtrlCreateLabel("IDMN - Prehires", 9, 593, 132, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label1Click")
$Button17 = GUICtrlCreateButton("KM16626", 9, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button17Click")
$Button18 = GUICtrlCreateButton("OBLIX", 89, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button18Click")
$Button19 = GUICtrlCreateButton("AD", 169, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button19Click")
$Button20 = GUICtrlCreateButton("Exchange", 249, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button20Click")
$TabSheet3 = GUICtrlCreateTabItem("IDMN Terms")
$Button12 = GUICtrlCreateButton("KM16643", 9, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button12Click")
$Button13 = GUICtrlCreateButton("OBLIX", 89, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button13Click")
$Button14 = GUICtrlCreateButton("Mobi Ctrl", 169, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button14Click")
$Button15 = GUICtrlCreateButton("Activ ID", 249, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button15Click")
$Button16 = GUICtrlCreateButton("Console", 329, 625, 75, 25)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlSetOnEvent(-1, "Button16Click")
$Label2 = GUICtrlCreateLabel("IDMN - Terms", 9, 593, 114, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label2Click")
$TabSheet4 = GUICtrlCreateTabItem("DST .dat Update")
$Label3 = GUICtrlCreateLabel("DST .dat Update", 12, 593, 131, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label3Click")
$Button5 = GUICtrlCreateButton("KM16697", 12, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button5Click")
$Button6 = GUICtrlCreateButton("Pinger", 92, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button6Click")
$Button7 = GUICtrlCreateButton("Results", 172, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button7Click")
$Button8 = GUICtrlCreateButton("MS Excel", 252, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button8Click")
$Button39 = GUICtrlCreateButton("DST Query", 336, 624, 75, 25)
GUICtrlSetOnEvent(-1, "Button39Click")
$addressIB = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "addressIBChange")
$raBTN = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "raBTNClick")
$pgBTN = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "pgBTNClick")
$slBTN = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "slBTNClick")
$luBTN = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "luBTNClick")
$stBTN = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "stBTNClick")
$obBTN = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "obBTNClick")
$TabSheet5 = GUICtrlCreateTabItem("SOX Audit")
$Label4 = GUICtrlCreateLabel("SOX Audit", 14, 595, 84, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label4Click")
$Button9 = GUICtrlCreateButton("KM16698", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button9Click")
$Button10 = GUICtrlCreateButton("Services.msc", 92, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button10Click")
$Button40 = GUICtrlCreateButton("Ping", 17, 697, 30, 20)
GUICtrlSetOnEvent(-1, "Button40Click")
$Button41 = GUICtrlCreateButton("PCName", 52, 697, 50, 20)
GUICtrlSetOnEvent(-1, "Button41Click")
$Button42 = GUICtrlCreateButton("User", 106, 697, 30, 20)
GUICtrlSetOnEvent(-1, "Button42Click")
$Button43 = GUICtrlCreateButton("SvcTag", 140, 697, 45, 20)
GUICtrlSetOnEvent(-1, "Button43Click")
$Button44 = GUICtrlCreateButton("Oblix", 189, 697, 30, 20)
GUICtrlSetOnEvent(-1, "Button44Click")
$Combo1 = GUICtrlCreateCombo("", 14, 667, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo1Change")
$Button45 = GUICtrlCreateButton("Remote", 149, 662, 50, 30)
GUICtrlSetOnEvent(-1, "Button45Click")
$TabSheet6 = GUICtrlCreateTabItem("EPO Rogues")
$Label5 = GUICtrlCreateLabel("EPO Rogue Machines", 12, 595, 171, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label5Click")
$Button11 = GUICtrlCreateButton("KM12871", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button11Click")
$Button21 = GUICtrlCreateButton("KM12873", 92, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button21Click")
$Button22 = GUICtrlCreateButton("KM12365", 172, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button22Click")
$Button46 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button46Click")
$Button47 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button47Click")
$Button48 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button48Click")
$Button49 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button49Click")
$Button50 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button50Click")
$Combo2 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo2Change")
$Button51 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button51Click")
$TabSheet7 = GUICtrlCreateTabItem("SWA Helpdesk")
$Label6 = GUICtrlCreateLabel("SWA Helpdesk", 12, 595, 120, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label6Click")
$Button23 = GUICtrlCreateButton("ACL Viewer", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button23Click")
$Button24 = GUICtrlCreateButton("Clone ID", 92, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button24Click")
$Button52 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button52Click")
$Button53 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button53Click")
$Button54 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button54Click")
$Button55 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button55Click")
$Button56 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button56Click")
$Combo3 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo3Change")
$Button57 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button57Click")
$TabSheet8 = GUICtrlCreateTabItem("IBM Tickets")
$Label7 = GUICtrlCreateLabel("IBM Tickets", 12, 595, 97, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label7Click")
$Button25 = GUICtrlCreateButton("IBM Logon", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button25Click")
$Button58 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button58Click")
$Button59 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button59Click")
$Button60 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button60Click")
$Button61 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button61Click")
$Button62 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button62Click")
$Combo4 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo4Change")
$Button63 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button63Click")
$TabSheet9 = GUICtrlCreateTabItem("Dell Tickets")
$Label8 = GUICtrlCreateLabel("Dell Tickets", 12, 595, 96, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label8Click")
$Button26 = GUICtrlCreateButton("Dell Logon", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button26Click")
$Button64 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button64Click")
$Button65 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button65Click")
$Button66 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button66Click")
$Button67 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button67Click")
$Button68 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button68Click")
$Combo5 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo5Change")
$Button69 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button69Click")
$TabSheet10 = GUICtrlCreateTabItem("Airtran Apps")
$Label9 = GUICtrlCreateLabel("AirTran Apps", 12, 595, 107, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label9Click")
$Button27 = GUICtrlCreateButton("FTWeb", 12, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button27Click")
$Button28 = GUICtrlCreateButton("ARS", 92, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button28Click")
$Button29 = GUICtrlCreateButton("NetTracer", 172, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button29Click")
$Button30 = GUICtrlCreateButton("Navitaire", 252, 628, 75, 25)
GUICtrlSetOnEvent(-1, "Button30Click")
$Button70 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button70Click")
$Button71 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button71Click")
$Button72 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button72Click")
$Button73 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button73Click")
$Button74 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button74Click")
$Combo6 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo6Change")
$Button75 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button75Click")
$TabSheet11 = GUICtrlCreateTabItem("SAAS")
$Label10 = GUICtrlCreateLabel("SAAS/Saberview", 12, 595, 137, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label10Click")
$Edit1 = GUICtrlCreateEdit("", 12, 622, 1033, 137)
GUICtrlSetData(-1, StringFormat("*Shortkey* for Closing Station: "&Chr(39)&""&Chr(39)&"staclose when it pauses, put in city code.\r\nThis should only have to be done 2x. Afterwards you will get confirmation\r\nstatement.\r\n\r\nSAAS Commands:\r\n\r\n1. Close A Flight\r\nR[city\r\nPCCflt# or PCCflt#OVR or PCCflt#/DDMMM\r\n\r\n2. Open A Flight\r\nR[city\r\nPCOflt# or PCOflt#OVR\r\n\r\n3. Board All PAX:\r\nPCGRDflt# then\r\nPCflt#/DDMMM then\r\nPGRflt#DDMMMcity-ON/ALL\r\n\r\n4. Open A Station\r\nR[city\r\nPCAAS001 then\r\nPSSOD1.0/DDMMM/CITY/<your saas sine>"))
GUICtrlSetOnEvent(-1, "Edit1Change")
$TabSheet12 = GUICtrlCreateTabItem("EOD")
$Label11 = GUICtrlCreateLabel("EOD", 12, 593, 38, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label11Click")
$Button31 = GUICtrlCreateButton("KM18277", 12, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button31Click")
$Button32 = GUICtrlCreateButton("CS2 Admin", 92, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button32Click")
$Button76 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button76Click")
$Button77 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button77Click")
$Button78 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button78Click")
$Button79 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button79Click")
$Button80 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button80Click")
$Combo7 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo7Change")
$Button81 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button81Click")
$TabSheet13 = GUICtrlCreateTabItem("Kiosks")
$Label12 = GUICtrlCreateLabel("Kiosks", 12, 593, 54, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label12Click")
$Button33 = GUICtrlCreateButton("KM4", 12, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button33Click")
$Button34 = GUICtrlCreateButton("Diagrams", 92, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button34Click")
$Button82 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button82Click")
$Button83 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button83Click")
$Button84 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button84Click")
$Button85 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button85Click")
$Button86 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button86Click")
$Combo8 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo8Change")
$Button87 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button87Click")
$TabSheet14 = GUICtrlCreateTabItem("VMWare")
$Label13 = GUICtrlCreateLabel("VMWare", 12, 593, 75, 27)
GUICtrlSetFont(-1, 14, 800, 0, "Calibri")
GUICtrlSetColor(-1, 0x000080)
GUICtrlSetOnEvent(-1, "Label13Click")
$Button35 = GUICtrlCreateButton("HCLPDC", 12, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button35Click")
$Button36 = GUICtrlCreateButton("HCLSDC", 92, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button36Click")
$Button37 = GUICtrlCreateButton("TCSPDC", 172, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button37Click")
$Button38 = GUICtrlCreateButton("TCSSDC", 252, 625, 75, 25)
GUICtrlSetOnEvent(-1, "Button38Click")
$Button88 = GUICtrlCreateButton("Ping", 17, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button88Click")
$Button89 = GUICtrlCreateButton("PCName", 52, 689, 50, 20)
GUICtrlSetOnEvent(-1, "Button89Click")
$Button90 = GUICtrlCreateButton("User", 106, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button90Click")
$Button91 = GUICtrlCreateButton("SvcTag", 140, 689, 45, 20)
GUICtrlSetOnEvent(-1, "Button91Click")
$Button92 = GUICtrlCreateButton("Oblix", 189, 689, 30, 20)
GUICtrlSetOnEvent(-1, "Button92Click")
$Combo9 = GUICtrlCreateCombo("", 14, 659, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo9Change")
$Button93 = GUICtrlCreateButton("Remote", 149, 654, 50, 30)
GUICtrlSetOnEvent(-1, "Button93Click")
$TabSheet15 = GUICtrlCreateTabItem("Misc. Tools")
$Button94 = GUICtrlCreateButton("Ping", 9, 633, 30, 20)
GUICtrlSetOnEvent(-1, "Button94Click")
$Button95 = GUICtrlCreateButton("PCName", 44, 633, 50, 20)
GUICtrlSetOnEvent(-1, "Button95Click")
$Button96 = GUICtrlCreateButton("User", 98, 633, 30, 20)
GUICtrlSetOnEvent(-1, "Button96Click")
$Button97 = GUICtrlCreateButton("SvcTag", 132, 633, 45, 20)
GUICtrlSetOnEvent(-1, "Button97Click")
$Button98 = GUICtrlCreateButton("Oblix", 181, 633, 30, 20)
GUICtrlSetOnEvent(-1, "Button98Click")
$Combo10 = GUICtrlCreateCombo("", 6, 603, 130, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "server")
GUICtrlSetOnEvent(-1, "Combo10Change")
$Button99 = GUICtrlCreateButton("Remote", 141, 598, 50, 30)
GUICtrlSetOnEvent(-1, "Button99Click")
GUICtrlCreateTabItem("")
$Pic1 = GUICtrlCreatePic("F:\AutoIt3\Tech Svcs.jpg", 0, 0, 636, 92)
GUICtrlSetOnEvent(-1, "Pic1Click")
$Combo11 = GUICtrlCreateCombo("Station", 8, 96, 97, 27)
GUICtrlSetData(-1, "ABQ|ALB|AMA|ATL|AUA|AUS|BDA|BDL|BHM|BKG|BNA|BOI|BOS|BUF|BUR|BWI|CAK|CHS|CLE|CLT|CMH|CRC|CRP|CUN|DAL|DAY|DCA|DEN|DSM|DTW|ECP|ELP|EWR|FLL|FNT|GEG|GPT|GRR|GSP|HOU|HRC|HRL|IAD|ICT|IND|ISP|JAN|JAX|LAS|LAX|LBB|LGA|LIT|MAF|MBJ|MCI|MCO|MDW|MEM|MEX|MHT|MKE|MSP|MSY|NAS|OAK|OKC|OMA|ONT|ORC|ORF|PBI|PDX|PHL|PHX|PIT|PNS|PRC|PVD|PWM|RDU|RIC|RNO|ROC|RSW|SAN|SAT|SDF|SEA|SFO|SJC|SJD|SJU|SLC|SMF|SNA|SRC|STL|TPA|TUL|TUS")
GUICtrlSetFont(-1, 10, 400, 0, "Calibri")
GUICtrlSetTip(-1, "Select Station")
GUICtrlSetOnEvent(-1, "Combo11Change")
$Edit2 = GUICtrlCreateEdit("", 648, 0, 425, 545)
GUICtrlSetData(-1, "Notepad")
GUICtrlSetFont(-1, 12, 400, 0, "Calibri")
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetOnEvent(-1, "Edit2Change")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg=$GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd

Func addressIBChange()

EndFunc
Func Button10Click()

EndFunc
Func Button11Click()

EndFunc
Func Button12Click()

EndFunc
Func Button13Click()

EndFunc
Func Button14Click()

EndFunc
Func Button15Click()

EndFunc
Func Button16Click()

EndFunc
Func Button17Click()

EndFunc
Func Button18Click()

EndFunc
Func Button19Click()

EndFunc
Func Button1Click()

EndFunc
Func Button20Click()

EndFunc
Func Button21Click()

EndFunc
Func Button22Click()

EndFunc
Func Button23Click()

EndFunc
Func Button24Click()

EndFunc
Func Button25Click()

EndFunc
Func Button26Click()

EndFunc
Func Button27Click()

EndFunc
Func Button28Click()

EndFunc
Func Button29Click()

EndFunc
Func Button2Click()

EndFunc
Func Button30Click()

EndFunc
Func Button31Click()

EndFunc
Func Button32Click()

EndFunc
Func Button33Click()

EndFunc
Func Button34Click()

EndFunc
Func Button35Click()

EndFunc
Func Button36Click()

EndFunc
Func Button37Click()

EndFunc
Func Button38Click()

EndFunc
Func Button39Click()

EndFunc
Func Button3Click()

EndFunc
Func Button40Click()

EndFunc
Func Button41Click()

EndFunc
Func Button42Click()

EndFunc
Func Button43Click()

EndFunc
Func Button44Click()

EndFunc
Func Button45Click()

EndFunc
Func Button46Click()

EndFunc
Func Button47Click()

EndFunc
Func Button48Click()

EndFunc
Func Button49Click()

EndFunc
Func Button4Click()

EndFunc
Func Button50Click()

EndFunc
Func Button51Click()

EndFunc
Func Button52Click()

EndFunc
Func Button53Click()

EndFunc
Func Button54Click()

EndFunc
Func Button55Click()

EndFunc
Func Button56Click()

EndFunc
Func Button57Click()

EndFunc
Func Button58Click()

EndFunc
Func Button59Click()

EndFunc
Func Button5Click()

EndFunc
Func Button60Click()

EndFunc
Func Button61Click()

EndFunc
Func Button62Click()

EndFunc
Func Button63Click()

EndFunc
Func Button64Click()

EndFunc
Func Button65Click()

EndFunc
Func Button66Click()

EndFunc
Func Button67Click()

EndFunc
Func Button68Click()

EndFunc
Func Button69Click()

EndFunc
Func Button6Click()

EndFunc
Func Button70Click()

EndFunc
Func Button71Click()

EndFunc
Func Button72Click()

EndFunc
Func Button73Click()

EndFunc
Func Button74Click()

EndFunc
Func Button75Click()

EndFunc
Func Button76Click()

EndFunc
Func Button77Click()

EndFunc
Func Button78Click()

EndFunc
Func Button79Click()

EndFunc
Func Button7Click()

EndFunc
Func Button80Click()

EndFunc
Func Button81Click()

EndFunc
Func Button82Click()

EndFunc
Func Button83Click()

EndFunc
Func Button84Click()

EndFunc
Func Button85Click()

EndFunc
Func Button86Click()

EndFunc
Func Button87Click()

EndFunc
Func Button88Click()

EndFunc
Func Button89Click()

EndFunc
Func Button8Click()

EndFunc
Func Button90Click()

EndFunc
Func Button91Click()

EndFunc
Func Button92Click()

EndFunc
Func Button93Click()

EndFunc
Func Button94Click()

EndFunc
Func Button95Click()

EndFunc
Func Button96Click()

EndFunc
Func Button97Click()

EndFunc
Func Button98Click()

EndFunc
Func Button99Click()

EndFunc
Func Button9Click()

EndFunc
Func Combo10Change()

EndFunc
Func Combo11Change()
    If $Combo11=("SEA") Then
    Run("F:\AutoIt3\Seattle Station.exe")
    EndIf
EndFunc

Share this post


Link to post
Share on other sites
Melba23

DaXman,

Welcome to the AutoIt forum. :)

I would do it like this:

; Add this to the other includes
#include Array.au3

; Create an array to hold the data to put in the combo and the associated file to run
Global $aArray[3][2] = [["ABQ", "F:\AutoIt3\ABQ Station.exe"], _
                        ["ALB", "F:\AutoIt3\ALB Station.exe"], _
                        ["AMA", "F:\AutoIt3\AMA Station.exe"]]
; I have only added 3 items but you can see how to proceed - note the use of the line continuation character
; If they are all on the same path you could omit that from the array to save space and add it just before running the file

; Now extract the combo elements from the array - that way you will only have valid entries in the combo
$sCombo_Data = ""
For $i = 0 To UBound($aArray) - 1
    $sCombo_Data &= "|" & $aArray[$i][0]
Next

; [...]

; And then when you create the combo:
$Combo11 = GUICtrlCreateCombo("Station", 8, 96, 97, 27)
GUICtrlSetData(-1, $sCombo_Data) ; And the data is in!

; [...]

; Finally the function to run when a selection is made:
Func Combo11Change()
    ; Read the combo
    $sSel = GUICtrlRead($Combo11)
    ; Search for the value in the array
    $iIndex = _ArraySearch($aArray, $sSel)
    If $iIndex = -1 Then
        ; This should not happen, but it is good practice to check
        MsgBox(0, "Oops!", "Not found")
    Else
        ; And here you run the file - I ma using a MsgBox to show it works
        MsgBox(0, "Now running", $aArray[$iIndex][1])
    EndIf
EndFunc   ;==>Combo11Change
All clear? Please ask if not. :)

M23

P.S. And when you post code, please make sure it is runnable. I had to comment out lots of GUICtrlSetOnEvent lines as the functions were missing - it puts a lot of people off if that sort of thing is necessary. So it is in your own best interests. ;)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×