NativeListBox

Class Overview
Provides operations on windows of WindowClass type ListBox.



public NativeListBox(WindowControl src)
Explanation
Constructor.

Parameter
          src
                  The original window control.


public NativeListBox(WindowsAppFriend app, IntPtr windowHandle)
Explanation
Constructor.

Parameters
app
Application manipulation object
windowHandle
Window handle



public int Count{get;}
Explanation
Returns the number of items in the control.



public int CurrentSelectedIndex{get;}
Explanation
Returns the currently selected index.
Please use SelectedIndices for multiple selection listboxes.



public Int32[] SelectedIndices{get;}
Explanation
Returns an array of all selected indices.
Please use CurrentSelectedIndex for single selection listboxes.



public int TopIndex{get;}
Explanation
Returns the index of the top item displayed in the list box.



public void EmulateChangeCurrentSelectedIndex(int index)
Explanation
Changes the currently selected index.
Causes a LBN_SELCHANGE notification.
Please use EmulateChangeSelect for multiple selection list boxes.

Parameter
index
Index to select



public void EmulateChangeCurrentSelectedIndex(int index, Async async)
Explanation
Changes the currently selected index.
Causes a LBN_SELCHANGE notification.
Please use EmulateChangeSelect for multiple selection list boxes.
Executes asynchronously.

Parameters
index
Index to select
async
Asynchronous execution object



public void EmulateChangeSelect(int index, bool isSelect)
Explanation
Sets the selected state of a specific item in the control.
Causes a LBN_SELCHANGE notification.
Please use EmulateChangeCurrentSelectedIndex for single selection list boxes.

Parameters
index
Index of the item
isSelect
Selects the item if true, deselects it if false


public void EmulateChangeSelect(int index, bool isSelect, Async async)
Explanation
Sets the selected state of a specific item in the control.
Causes a LBN_SELCHANGE notification.
Please use EmulateChangeCurrentSelectedIndex for single selection list boxes.
Executes asynchronously.

Parameters
index
Index of the item
isSelect
Selects the item if true, deselects it if false
async
Asynchronous execution object.



public FindItem(int findStart, string text)
Description
Finds an item with the indicated text.

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

Argument
findStart
Index where searching should start
text
Text to search for



public IntPtr GetItemData(int index)
Explanation
Returns the data for the indicated item

Return value
Item data

Parameter
index
Index of the item



public Rectangle GetItemRect(int index)
Explanation
Returns the client rectangle of the item with the indicated index.

Return value
Returns -1 in the case of failure.

Parameter
index
Index of the item



public string GetItemText(int index)
Explanation
Returns the text of the indicated item

Return value
Item text

Parameter
index
Index of the item



public void SetTopIndex(int index)
Explanation
Scrolls the list so that the item with the indicated index is the top item.
When it is not possible to show the indicated item at the top, the list is scrolled so that the indicated item is visible.

Parameter
index
head index.

JR