Make ComboBox DropDown visible in code

Ask general questions here.
stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Make ComboBox DropDown visible in code

Post by stapes » Fri Oct 16, 2015 2:54 pm

How do I make the DropDown part of a ranorex.ComboBox visible.

Code: Select all

Ranorex .ComboBox  comboBox=repo.Form365AgilePortal.FormsContainer.FieldPropertiesForm.AnswerTypeComboBox;
if(!comboBox .DropDownVisible )
        	{
        		// .. to go here ...
        	}
This is very frustrating.

I can open the combo box on screen by clicking the down arrow, but it closes as soon as I touch anything else.
I tried clicking the arrow in code, but all that happens is the control changes color:

Code: Select all

repo.Form365AgilePortal.FormsContainer.FieldPropertiesForm.BtnArrowBackground1.Click ();
I want to be able to search the contents of the combo box, at the moment it can't see them.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Make ComboBox DropDown visible in code

Post by Support Team » Mon Oct 19, 2015 4:27 pm

Hello stapes,

Usually, you can set the attribute value "DropDownVisible" to "true" in order to expand the items in a combobox.
repo.Preferences.MyComboBox.Element.SetAttributeValue("DropDownVisible", "true");
I hope that helps.

Regards,
Bernhard

stapes
Posts: 206
Joined: Wed Sep 16, 2015 10:55 am

Re: Make ComboBox DropDown visible in code

Post by stapes » Wed Oct 21, 2015 3:35 pm

That does the trick, thank you.