null0 Posted November 5, 2018 Posted November 5, 2018 Hey everyone, I am working on a GUI ComboBox that will execute various SEND commands when a $idComboBox is selected. What I have so far #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $hGUI = GUICreate("Site 1", 300, 200) Local $idComboBox = GUICtrlCreateCombo("Site1", 10, 10, 185, 20) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) GUICtrlSetData($idComboBox, "Site 2|Site 3") GUISetState(@SW_SHOW, $hGUI) Local $sComboRead = "" What function would I use that does something like If selected Site 3 then SEND("{UP}{DOWN{TAB}B{TAB}A{TAB}SELECT{TAB}START{TAB}{Enter}") Thank you for taking the time to read this.
KickStarter15 Posted November 6, 2018 Posted November 6, 2018 Have you tried If statement? If GUICtrlRead($idComboBox) = "Site 3" Then ;do the send command here.. EndIf Programming is "To make it so simple that there are obviously no deficiencies" or "To make it so complicated that there are no obvious deficiencies" by C.A.R. Hoare.
FrancescoDiMuro Posted November 6, 2018 Posted November 6, 2018 @null0 If you are trying to automate a website, then take a look at _IE* functions in the Help file instead of send commands Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
caramen Posted November 6, 2018 Posted November 6, 2018 Hello, @null0 When i do what you want to do. I manage that like this : First i read all control in a separate function so i dont pollute my initial code : Func ReadCategory () ;~ Global $cCategory01 = GUICtrlRead ( $cCombo01 ) ; Global $cCategory001 = GUICtrlRead ( $cCombo001 ) Global $cCategory0001 = GUICtrlRead ( $cCombo0001 ) ; Global $cCategory00001 = GUICtrlRead ( $cCombo00001 ) ; Global $cCategory000001 = GUICtrlRead ( $cCombo000001 ) ; Global $cCategory0000001 = GUICtrlRead ( $cCombo0000001 ) ; Global $cCategory02 = GUICtrlRead ( $cCombo03 ) ; Global $cCategory002 = GUICtrlRead ( $cCombo003 ) ; Global $cCategory0002 = GUICtrlRead ( $cCombo0003 ) ; Global $cCategory00002 = GUICtrlRead ( $cCombo00003 ) ; Global $cCategory000002 = GUICtrlRead ( $cCombo000003 ) ; Global $cCategory0000002 = GUICtrlRead ( $cCombo0000003 ) ;================================================================= ;~ Global $cSubCategory01 = GUICtrlRead ( $cCombo02 ) ; Global $cSubCategory001 = GUICtrlRead ( $cCombo002 ) Global $cSubCategory0001 = GUICtrlRead ( $cCombo0002 ) ; Global $cSubCategory00001 = GUICtrlRead ( $cCombo00002 ) ; Global $cSubCategory000001 = GUICtrlRead ( $cCombo000002 ) ; Global $cSubCategory0000001 = GUICtrlRead ( $cCombo0000002 ) ; Global $cSubCategory02 = GUICtrlRead ( $cCombo04 ) ; Global $cSubCategory002 = GUICtrlRead ( $cCombo004 ) ; Global $cSubCategory0002 = GUICtrlRead ( $cCombo0004 ) ; Global $cSubCategory00002 = GUICtrlRead ( $cCombo00004 ) ; Global $cSubCategory000002 = GUICtrlRead ( $cCombo000004 ) ; Global $cSubCategory0000002 = GUICtrlRead ( $cCombo0000004 ) ;~ =============================================================== Global $cCombo0003Readed = GUICtrlRead ( $cCombo0003 ) EndFunc After that i code my GUI: Case $cCombo0001 ;Here I check if the Combo is selected by his VarID ReadCategory () ;Now i read the combot ( first function showed ) If $cCategory0001 = "WhatIWant" Then ; If the combo is what i want then i do my stuff ... ... ... EndIf My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki
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