I have a header which I cna expand and collapse and I want to check if it is collapsed.
After I collapse it, I cant get the element state to State.Collapsed. Its only shown as readonly.
How can I get this thing to work?
State.expanded and State.Collapsed
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Sorry, I don't quite understand. Do you want to check the state of the element or do you want to change it? The state of an element is readonly, so you can't change by setting a new value to the property. The only way to change the state of an element is by calling Element.DoDefaultAction() or by mouse/keyboard input.
If you just want to test whether an element is collapsed or expanded, you have to check if the Collapsed/Expanded flags are set in the Element.State:
Regards,
Alex
Ranorex Support Team
If you just want to test whether an element is collapsed or expanded, you have to check if the Collapsed/Expanded flags are set in the Element.State:
Code: Select all
bool isCollapsed = (myElement.State & State.Collapsed) != 0;
bool isExpanded = (myElement.State & State.Expanded) != 0;
Alex
Ranorex Support Team
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact: