NativeComboBox

Class Overview
Provides operations on windows whose WindowClass is ComboBox orComboBoxEx32



public NativeComboBox(WindowControl src)
Explanation
Constructor.

Parameters
src
WindowControl with the target window handle



public NativeComboBox(WindowsAppFriend app IntPtr windowHandle)
Explanation
Constructor.

Parameters
app
Application manipulation object
windowHandle
Window handle



public int ItemCount{ get; }
Explanation
Returns the number of items in this combo box.



public int SelectedItemIndex{ get; }
Explanation
Returns the index of the currently selected item.



public string Text{ get; }
Explanation
Returns the window text.



public void EmulateChangeDropDownVisible(bool visible)
Explanation
Changes the DropDown Visible state. 
If a dropdown is opened, CBN_DROPDOWN is notified.
If a drop down is closed, CBN_CLOSEUP is notified.

Parameters
visible
Visible state of the window



public void EmulateChangeDropDownVisible(bool visible, Async async)
Explanation
Changes the DropDown Visible state. 
If a dropdown is opened, CBN_DROPDOWN is notified.
If a drop down is closed, CBN_CLOSEUP is notified.
Executes asynchronously.

Parameters
visible
Visible state of the window
async
Asynchronous execution object



public void EmulateChangeEditText(string newText)
Explanation
Changes the editor text.
Notifies CBN_EDITCHANGE
.
If the window is a ComboBox, CBN_EDITUPDATE is notified as well.

Parameter
newText
The text to set



public void EmulateChangeEditText(string newText, Async async)
Explanation
Changes the editor text. 
Notifies CBN_EDITCHANGE.
If the window is a ComboBox, CBN_EDITUPDATE is notified as well.
Executes asynchronously.

Parameters
newText
The text to set
async
Asynchronous execution object


public void EmulateSelectItem(int index)
Explanation
Sets the selected item.
If the selected index is changed, CBN_SELENDOK and CBN_SELCHANGE are notified.
For a ComboBoxEx32 that is not a dropdown list, CBN_EDITCHANGE is notified as well.

Parameter
index
Index of the item to select.



public void EmulateSelectItem(int index, Async async)
Explanation
Sets the selected item.
If the selected index is changed, CBN_SELENDOK and CBN_SELCHANGE are notified.
For a ComboBoxEx32 that is not a dropdown list, CBN_EDITCHANGE is notified as well.
Executes asynchronously.

Parameters
index
Index of the item to select.
async
Asynchronous execution object



public int FindItem(int findStart, string text)
Explanation
Searches for an item with the indicated text. 

Return Value
Index of the found item.
Returns -1 if the item is not found. 

Parameters
findStart
Index where searching should start
text
Target text



public IntPtr GetItemData(int index)
Explanation
The 32-bit value can be set with the dwItemData parameter of a SetItemData member function call. Uses the GetItemDataPtr member function if the 32-bit value to be retrieved is a pointer (void*).

Return Value
The 32-bit value associated with the item, or CB_ERR if an error occurs.

Parameter
index
The zero-based index of an item in the combo box's list box.



public int GetItemText(int index)
Explanation
Returns the text for the indicated item. 

Return Value
Text of the item.

Parameter
index
Target index


JR