Select value in the dropdown combobox

Hi Everyone,

I have been trying to select a value from a Win32 ComboBox via Windows.Get Element, and I have already referred to these two topics:

The target application is a Windows desktop application called Minfos.

I am using Windows Get Element to get the Gender ComboBox. In debug mode, I can see that the element has SupportSelect = True, and under Items I can see the three options:

  • Not Stated.
  • Female.
  • Male.

However, assigning the value does not seem to change the selected option.

I tried:

item.Value = “Male.”

item.Text = “Male.”

item.name =“Male.”

I also tried looking for item.Text, but item.Text does not appear as an available property for this element. I can only see properties like Name and Value. The current Value is null.

Here is what I can see in the debugger:

  • SupportInput = False
  • SupportSelect = True
  • Value = null
  • Items length/count = 3
  • Items[0] = ListItem Name: Not Stated.
  • Items[1] = ListItem Name: Female.
  • Items[2] = ListItem Name: Male.

My question is: for a Windows ComboBox where SupportSelect is True and the options are visible in item.Items, what is the correct way to select one of the ListItems?

Thank you.

item.Value should be the correct way. Using Assign, you could also try setting item.SelectedIndex to 1 or 2. Or using invoke code, you could also try (if using VB, use Items[1] and add a ; if using C#)

item.SelectItem(item.Items(1))

What concerns me is the SupportInput = False. This is normally a sign that this field is read-only and should not be changed, so it could be me checking for that in the code. See if one of the above “bypasses” that check.