Jump to content

Need help with combo box handling using AutoIT - (Moved)


Go to solution Solved by Soundarya,

Recommended Posts

Posted

My desktop application already have a combo box with options listed. I have used "_GUICtrlComboBox_SetCurSel", to select the option that I need. The combo box Edit area is updated with the new value as I selected using "_GUICtrlComboBox_SetCurSel".

Then I have a button which I can click and it shows which option is selected. Though the combo box displayed the option I selected, the message still shows my default value. Then when I manually go and click the combo box drop down and click on the option in drop down, then the message displays the correct option. I think _GUICtrlComboBox_SetCurSel is just changing the test in edit area and really not selecting the option ?

 

Code

Local $hDTP = ControlGetHandle( $Control, "", "WindowsForms10.COMBOBOX.app.0.bb8560_r18_ad11")

_GUICtrlComboBox_SetCurSel($hDTP,10)

It changes the combo box value from "System 3" to "Integration". But when I try to submit the job it is still referring "System 3"

image.png.48d4073a27c52d9c444c8c5bc2816d1e.png

image.png.aeadd230f8a742b39a7a36e485f6cb2b.png

 

When I go ahead and change manually it is working fine

image.png.af6e86118a22b1220c2a9a96a9313113.png

image.png.74b34361af9526dd077825354fa8cb05.png

image.png

  • Developers
Posted (edited)

Moved to the appropriate forum. This is the second time so please simply use the support forum when you don't know were to post it!

Moderation Team

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted
  • Solution
Posted

Finally with multiple trial and errors found a solution. Adding the code if it might help anyone struggling with same problem

Local $hDTP = ControlGetHandle( $Control, "", "WindowsForms10.COMBOBOX.app.0.bb8560_r18_ad11")
ControlClick($Control,"","WindowsForms10.COMBOBOX.app.0.bb8560_r18_ad11")
Local $hCTR = ControlCommand($Control,"","WindowsForms10.COMBOBOX.app.0.bb8560_r18_ad11","ShowDropDown","")
_GUICtrlComboBox_SelectString($hDTP,"Integration")
Local $iSelect = _GUICtrlComboBox_GetCurSel($hDTP)
ControlClick($hCTR,"",$iSelect)

Posted

Thanks Nine, it did worked. I followed similar approach you have suggested. I have handled the combo box using ControlGetHandle. Then I did controlcommand to show the dropdown. Then using GUICtrlComboBox_SelectString, I have sent my selection. The I got the index of the selection using  _GUICtrlComboBox_GetCurSel, then did a control click on it

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...