Class DropdownList
Dropdown list control
public class DropdownList : Button
- Inheritance
-
DropdownList
- Inherited Members
- Extension Methods
Constructors
DropdownList(Dialog)
Create new dropdown list control
public DropdownList(Dialog parent)
Parameters
parent
Dialog
Fields
ComboButtonLayer
public const int ComboButtonLayer = 1
Field Value
DropdownLayer
public const int DropdownLayer = 2
Field Value
MainLayer
public const int MainLayer = 0
Field Value
SelectionLayer
public const int SelectionLayer = 3
Field Value
buttonRect
protected Rectangle buttonRect
Field Value
dropDownRect
protected Rectangle dropDownRect
Field Value
dropDownTextRect
protected Rectangle dropDownTextRect
Field Value
dropHeight
protected int dropHeight
Field Value
focusedIndex
protected int focusedIndex
Field Value
isComboOpen
protected bool isComboOpen
Field Value
itemList
protected List<ListItem> itemList
Field Value
scrollWidth
protected int scrollWidth
Field Value
scrollbarControl
protected ScrollBar scrollbarControl
Field Value
selectedIndex
protected int selectedIndex
Field Value
textRect
protected Rectangle textRect
Field Value
Properties
CanHaveFocus
Can this control have focus
public override bool CanHaveFocus { get; }
Property Value
this[int]
Indexer for items in the list
public ListItem this[int index] { get; }
Parameters
index
int
Property Value
NumberItems
Number of items current in the list
public int NumberItems { get; }
Property Value
Methods
AddItem(string, string, object)
Adds an item to the dropdown list control
public void AddItem(string text, string tag, object data)
Parameters
Clear()
Removes all items from the control
public void Clear()
ContainsItem(string)
Determines whether this control contains an item
public bool ContainsItem(string text)
Parameters
text
string
Returns
ContainsItem(string, int)
Determines whether this control contains an item
public bool ContainsItem(string text, int start)
Parameters
Returns
FindItem(string)
Finds an item in the list and returns the index
protected int FindItem(string text)
Parameters
text
string
Returns
FindItem(string, int)
Finds an item in the list and returns the index
protected int FindItem(string text, int start)
Parameters
Returns
GetItemData(string)
Gets the data for an item
public object GetItemData(string text)
Parameters
text
string
Returns
GetSelectedData()
Gets the data for the selected item
public object GetSelectedData()
Returns
GetSelectedItem()
Gets the selected item
public ListItem GetSelectedItem()
Returns
HandleKeyboard(WindowMessage, IntPtr, IntPtr)
Called when the control needs to handle the keyboard
public override bool HandleKeyboard(WindowMessage msg, IntPtr wParam, IntPtr lParam)
Parameters
msg
WindowMessagewParam
IntPtrlParam
IntPtr
Returns
HandleMouse(WindowMessage, Point, IntPtr, IntPtr)
Called when the control should handle the mouse
public override bool HandleMouse(WindowMessage msg, Point pt, IntPtr wParam, IntPtr lParam)
Parameters
msg
WindowMessagept
PointwParam
IntPtrlParam
IntPtr
Returns
OnFocusOut()
Called when focus leaves the control
public override void OnFocusOut()
OnHotKey()
Called when the control's hotkey is pressed
public override void OnHotKey()
OnInitialize()
Initialize the scrollbar control here
public override void OnInitialize()
RaiseChangedEvent(DropdownList, bool)
Create new button instance
protected void RaiseChangedEvent(DropdownList sender, bool wasTriggeredByUser)
Parameters
sender
DropdownListwasTriggeredByUser
bool
RemoveAt(int)
Removes an item at a particular index
public void RemoveAt(int index)
Parameters
index
int
Render(Device, float)
Called when the control should be rendered
public override void Render(Device device, float elapsedTime)
Parameters
device
DeviceelapsedTime
float
SetDropHeight(int)
Sets the drop height of this control
public void SetDropHeight(int height)
Parameters
height
int
SetScrollbarWidth(int)
Sets the scroll bar width of this control
public void SetScrollbarWidth(int width)
Parameters
width
int
SetSelected(int)
Sets the selected item by index
public void SetSelected(int index)
Parameters
index
int
SetSelected(string)
Sets the selected item by text
public void SetSelected(string text)
Parameters
text
string
UpdateRectangles()
Update the rectangles for the dropdown list control
protected override void UpdateRectangles()
Events
Changed
public event EventHandler Changed