Sign in to follow this  
Followers 0
callagga

selecting ComboBox item not working???

6 posts in this topic

Hi,

I'm getting stuck trying to set the selection for a combobox. Is there something I'm missing? Code is below. Note the "ShowDropDown" works, but the "GetCurrentSelection" does not, nor does the "GetCurrentSelection". I also not when I use "AutoIt v3 Window Info" and target the combobox I see black under the Control Text, nor can I find anywhere in the Text where I can read all the combobox drop down text values?

Any ideas?

$windowTitle = "[CLASS:WFC.window.8]"
Opt("WinTitleMatchMode",4)  ;Advanced Search Mode
WinActivate ($windowTitle)

ControlCommand ( $windowTitle, "", "[CLASS:WFC.COMBOBOX; INSTANCE:1]", "ShowDropDown") 
; ==> WORKS 

ControlCommand ( $windowTitle, "", "[CLASS:WFC.COMBOBOX; INSTANCE:1]", "GetCurrentSelection") 
; ==> DOESN'T WORK.  GIVES A RETURN VALUE OF 0 (even though I can see 'Closed' selected in the Combo box)

ControlCommand($windowTitle, "", "WFC.COMBOBOX1", 'SelectString', 'Open')
; ==> DOESN"T WORK

Thanks

Share this post


Link to post
Share on other sites



PS. If there's some reason why I will not be able to use ControlCommand, and instead have to use Send, then what is the command to get the combobox focus/active set so I can then just send the first character (e.g. Send("o"))?

Share this post


Link to post
Share on other sites

PS. If there's some reason why I will not be able to use ControlCommand, and instead have to use Send, then what is the command to get the combobox focus/active set so I can then just send the first character (e.g. Send("o"))?

You would use ControlSend(), not Send() for better reliability. You could ControlFocus() first, but it probably isn't required.

>_<


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

You would use ControlSend(), not Send() for better reliability. You could ControlFocus() first, but it probably isn't required.

thanks

Is winactivate sometimes required here?

Share this post


Link to post
Share on other sites

thanks

Is winactivate sometimes required here?

For Send(), yes. Not for ControlSend(), which even works on most minimized windows.

>_<


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

hello sir/madam

MouseMove(527,523)

MouseDown("left")

MouseUp("left")

$value12=$val12[$j];this value iam getting from excel sheet

Controlsend("ClearVision_V1.8.9.0","","WindowsForms10.COMBOBOX.app.0.378734a1",$value12)

send("{TAB}")

iam using excel sheet to get values and print in the .net application.iam getting correct value from excel sheet.

But while printing in combobox the value selected is last letter value.why this is happening?

example

Bangladesh :value from excel sheet

value printed in combobox is haiti

i have checked with all control commands.

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  
Followers 0