Select a list item by its name

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

Syntax

C#
public void Select(
	int index
)
Visual Basic (Declaration)
Public Sub Select ( _
	index As Integer _
)
Visual C++
public:
virtual void Select(
	int index
) sealed

Parameters

index
Type: System..::.Int32
The index to select, first item is 0

Examples

CopyC#
System.Diagnostics.Process.Start("notepad");
UIAWindow notepadWin = Desktop.UIA[@"Untitled - Notepad", @"Notepad", @"UIAWindow"] as UIAWindow;
UIDocument doc = notepadWin[@"", @"Edit", @"15"] as UIDocument;
doc.Write("{LeftAlt}of");
UIAWindow fontWin = notepadWin[@"Font", @"#32770", @"UIAWindow"] as UIAWindow;
UIAListBox sizeList = fontWin[@"Size:", @"ComboBox", @"1138"][@"Size:", @"ComboLBox", @"ListBox"] as UIAListBox;
sizeList.Select(8);//select size 20
fontWin[@"OK", @"Button", @"1"].Click();
doc.Write("Text size is 20");

See Also