Vinodh Posted January 23, 2012 Share Posted January 23, 2012 Hi Friends How to assign name of the control to a variable? Thanks Vinodh Anandhan Link to comment Share on other sites More sharing options...
Vinodh Posted January 23, 2012 Author Share Posted January 23, 2012 My application is an external one so i found name of the control (combobox) using "AutoIT v3 window info" tool. Now i want to set value of the combo box. How to assign the combobox name to a variable or how to set value to combobox? Link to comment Share on other sites More sharing options...
Beege Posted January 23, 2012 Share Posted January 23, 2012 Look at ControlCommand() in the help doc. That should do what your asking. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Vinodh Posted January 24, 2012 Author Share Posted January 24, 2012 Hi I am having a combo box on my screen name: ComboBox1 with 2 values I want to select the second value on the combobox I am getting msg box with current selection as "0" focus is also working. Control command is not working as expected MsgBox(4160, "Information", "Cur Sel: " & _GUICtrlComboBox_GetCurSel("ComboBox1")) ControlFocus ( "Deposit Information Entry", "", "ComboBox1" ) ControlCommand("Deposit Information Entry", "", "WindowsForms10.COMBOBOX.app.0.2bf8098_r13_ad13", "SetCurrentSelection", 1) Please help Link to comment Share on other sites More sharing options...
Beege Posted January 24, 2012 Share Posted January 24, 2012 (edited) Don't use _GUICtrlComboBox_GetCurSel() unless the combobox was created by you using _GUICtrlComboBox_Create().Does your "SetCurrentSelection" selection command work? if so all you should need is :$selection = ControlCommand("Deposit Information Entry", "", "WindowsForms10.COMBOBOX.app.0.2bf8098_r13_ad13", "GetCurrentSelection", 1) msgbox(0,'',$selection)Also try to use the autoit tags when you post your code. You should see a square blue button with an A in it on the toolbar.edit: woops. just changed that code Edited January 24, 2012 by Beege Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Vinodh Posted January 24, 2012 Author Share Posted January 24, 2012 HiThanks for your replyI think i am not explaining my need properly. I am very sorry for that. I am new to autoIt so pleaseScenario:I am having a dropdown "ComboBox1" on my screen "Sceen 1" (Every Time when screen loads ID is keeps on changing).combo box is not created using _GUICtrlComboBox_Create().Combobox is having two valuesa) AAAA (Default) BBBBI want to select "BBBB" in ComboBox1.I tried above code both with GetCurrentSelection and SetCurrentSelection both are returning 0 as result.Could you please help to overcome this situation Link to comment Share on other sites More sharing options...
water Posted January 24, 2012 Share Posted January 24, 2012 As the application you try to automate uses WindowsForms controls you might need to search the forum how to handle WindowsForms (one of the threads you'll find is ).Unfortunately I've never automated such controls myself. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Beege Posted January 24, 2012 Share Posted January 24, 2012 Where did you get "WindowsForms10.COMBOBOX.app.0.2bf8098_r13_ad13" from? Do you know how to use the Window Info tool? Make sure you are using values from advanced mode. Heres a example to go with a pic:$selection = ControlCommand("(UDF) ComboBox Create", "", "[CLASS:ComboBox; INSTANCE:1]", "GetCurrentSelection") Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator Link to comment Share on other sites More sharing options...
Vinodh Posted January 24, 2012 Author Share Posted January 24, 2012 Hi I found solution to select value in combobox which is windowsFormsContrl 1. I set focus on that control 2. then send down right now i have only two values. This is ok for me.. Thanks for help Vinodh 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