Get the current expand \ collapse state of the menu

Namespace:  QAliber.Engine.Controls.UIA
Assembly:  QAliber.Engine (in QAliber.Engine.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public ExpandCollapseState ExpandCollapseState { get; }
Visual Basic (Declaration)
Public ReadOnly Property ExpandCollapseState As ExpandCollapseState
Visual C++
public:
virtual property ExpandCollapseState ExpandCollapseState {
	ExpandCollapseState get () sealed;
}

Remarks

ExpandCollapseState Enum: Collapsed = 0, No child nodes, controls, or content of the UI Automation element are displayed. Expanded = 1, All child nodes, controls or content of the UI Automation element are displayed. PartiallyExpanded = 2, Some, but not all, child nodes, controls, or content of the UI Automation element are displayed. LeafNode = 3 The UI Automation element has no child nodes, controls, or content to display.

Examples

CopyC#
System.Diagnostics.Process.Start("notepad");
 UIAWindow notepadWin = Desktop.UIA[@"Untitled - Notepad", @"Notepad", @"UIAWindow"] as UIAWindow;
 UIAMenuItem fileMenue = notepadWin[@"Application", @"", @"MenuBar"][@"File", @"", @"Item 1"] as UIAMenuItem;
 fileMenue.Expand();
 System.Threading.Thread.Sleep(3000);
 if (fileMenue.ExpandCollapseState == System.Windows.Automation.ExpandCollapseState.Expanded)
      fileMenue.Collapse();

See Also