Select the item in the list as single selection

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()
Visual Basic (Declaration)
Public Sub Select
Visual C++
public:
virtual void Select() sealed

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 fontsStyle = fontWin[@"Font:", @"ComboBox", @"1136"][@"Font:", @"ComboLBox", @"ListBox"] as UIAListBox;
UIAListItem selectedItem = (UIAListItem) fontsStyle.SelectedItems[0];

MessageBox.Show("Selected item: " + selectedItem.Name + ". Click OK to Change selection...");
fontsStyle.Select(4);
MessageBox.Show("Click OK to change selection back to: " + selectedItem.Name);
selectedItem.Select();

See Also