Selecting ComboBox With Dynamic Lists
Finding a unique problem that I can't resolve.
The application has two comboboxes - one for country and another for province.
Depending on the setting for Country (ex. Canada, United Sates), you get different selections available to you on the second combobox (ex. if select Canada - you get the 11 provinces, if select United States you get the 50 states.)
So I have done the following.
set comboboxProvince = ...
set comboboxProvince = comboboxProvince.WinFormsObject("childCombo")
itemCount = comboboxProvince.Items.get_Count
itemCount = comboboxProvince.wItemCount
Problem is that comboboxProvince.Items.get_Count does not return the true count in the list and comboboxProvince.wItemCount does not always work.
Any suggestions on how to get the proper list count.
Using the Object Properties Tool does not always give the correct value unless I've manunally selected the dropdown list and then use the Object Tool.
Re: Selecting ComboBox With Dynamic Lists
The problem can be caused by the fact that the items list of the second combo box is updated only when you open its drop-down list.
In this case, to get the correct information about the combo box items, you need to open its drop-down list after changing the selection in the first combo box. To open the drop-down list, you can use the DropDown method. Please see the "Win32ComboBox.DropDown" help topic for more information.