Jump to content

How to set a value of combobox


Noe
 Share

Recommended Posts

I am coding a script to automate an operation for application. During the operation, I will select a item from a .net combobox control. The the code likes below. But seems not work.

ControlCommand("WinTitle","WinText","WindowsForms10.COMBOBOX.app31","SelectString", "LA")

There should be no problem for the recognization of the control as when I used the command parameter "ShowDropDown". The dropdown list is shown.

Can anyone help me figure out what's wrong here? Or is there any other solutions?

As that combobox is not created by GuiCtrlCreate, I think I can not use any function in GuiCombobox.au3, right?

Link to comment
Share on other sites

  • Moderators

I am coding a script to automate an operation for application. During the operation, I will select a item from a .net combobox control. The the code likes below. But seems not work.

ControlCommand("WinTitle","WinText","WindowsForms10.COMBOBOX.app31","SelectString", "LA")

There should be no problem for the recognization of the control as when I used the command parameter "ShowDropDown". The dropdown list is shown.

Can anyone help me figure out what's wrong here? Or is there any other solutions?

As that combobox is not created by GuiCtrlCreate, I think I can not use any function in GuiCombobox.au3, right?

Sorry, the crystal ball is broken today... Got your script anywhere? ... Would you like to post it so we can see what the issue is?

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Sorry, the crystal ball is broken today... Got your script anywhere? ... Would you like to post it so we can see what the issue is?

You must spend a fortune on crystal balls the amount of them you break :lmao:;)


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Sorry, the crystal ball is broken today... Got your script anywhere? ... Would you like to post it so we can see what the issue is?

Below is the code. The attached snapshot is the window I want to operate.

;====================

#include <File.au3>

Dim $appDir="I:\Program Files\DriveCam\HindSight Admin Tools\"

Dim $expWin

; ====================================================

; Launch admin tools

Run($appDir & "adminTool.exe")

; ====================================================

; Login

WinWaitActive("Login - Admin Tools","Version")

ControlSetText("Login - Admin Tools","Version","WindowsForms10.EDIT.app31","aaa")

ControlSetText("Login - Admin Tools","Version","WindowsForms10.EDIT.app32","aaa")

ControlClick("Login - Admin Tools","Version","WindowsForms10.BUTTON.app31")

; ====================================================

; Launch Registration Dialog

ControlClick("Admin Tools","","WindowsForms10.window.8.app32")

; ====================================================

; Register

ControlSetText("HindSight Registration","Company Information","WindowsForms10.EDIT.app35","sdfasdfasfddfads@3424234453")

ControlSetText("HindSight Registration","Company Information","WindowsForms10.EDIT.app34","sdfdasrersjguytuasdfasfddfads@3424234453")

ControlSetText("HindSight Registration","Company Information","WindowsForms10.EDIT.app31","sdfasdfasfddfadsvdtyt@3424234453")

ControlSetText("HindSight Registration","Company Information","WindowsForms10.EDIT.app33","Noe's City")

ControlCommand("HindSight Registration","Company Information","WindowsForms10.COMBOBOX.app31","SelectString", "LA")

Link to comment
Share on other sites

  • Moderators

You might want to take a look at 'ControlCommand', and ShowDropDown.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

You might want to take a look at 'ControlCommand', and ShowDropDown.

I tried the code below:

ControlCommand("HindSight Registration","Company Information","WindowsForms10.COMBOBOX.app31","ShowDropDown", "")

But it only dropdown the list of that combobox, not select an item. :lmao:

Link to comment
Share on other sites

Im taking a HUGE guess :

ControlCommand("HindSight Registration","","WindowsForms10.COMBOBOX.app31","ShowDropDown", "LA").

If it doesn't work, im not suprised.

Then How to use controlcommand to select an item in combobox?

Link to comment
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
 Share

  • Recently Browsing   0 members

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