c# - Change WinForms combo box selection with UI Automation -


Is it possible to change the selected item in a winforms application using C # UI Automation (similar to UISP.exe) is? I would like to change the selected items in a specific item (I know that this is the index / position in the list).

  public static action verbatemboboxime (AutomationAlment combobox element, int indexToSeclect) {if (combo box Element == blank) new exception throw ("combo box not found"); // combo box automation element collection comboboxyyyyyy = combo box element.findl (Treescope children, new property condition (automation element.control typepraty, control type .list)) get all the list items; // Expand the combobox Expand Expand thecolap section Pattern = (expand gender page) combo box element. GetCurrentPattern (ExpandCollapsePattern.Pattern); ExpandPattern.Expand (); // to set the index in the combo box AutomationAllension ItemToCatch = Compaboxyitum [IndexTourseTech]; // To locate the pattern, select the Selecttenment Pattern from the Pattern = (Selection Item Partition) item. Gate customer page (selection etc. Pattern); SelectPattern.Select (); }  

Comments