ListBox Class

Definition

Represents a Windows control to display a list of items.

[System.ComponentModel.DefaultBindingProperty("SelectedValue")]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDispatch)]
[System.Runtime.InteropServices.ComVisible(true)]
public class ListBox : System.Windows.Forms.ListControl
Inheritance
Derived
Attributes

Examples

The following code example demonstrates how to create a ListBox control that displays multiple items in columns and can have more than one item selected in the control's list. The code for the example adds 50 items to the ListBox using the Add method of the ListBox.ObjectCollection class and then selects three items from the list using the SetSelected method. The code then displays values from the ListBox.SelectedObjectCollection collection, through the SelectedItems property, and the ListBox.SelectedIndexCollection, through the SelectedIndices property. This example requires that the code is located in and called from a Form.

void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   
   // Create an instance of the ListBox.
   ListBox^ listBox1 = gcnew ListBox;
   
   // Set the size and location of the ListBox.
   listBox1->Size = System::Drawing::Size( 200, 100 );
   listBox1->Location = System::Drawing::Point( 10, 10 );
   
   // Add the ListBox to the form.
   this->Controls->Add( listBox1 );
   
   // Set the ListBox to display items in multiple columns.
   listBox1->MultiColumn = true;
   
   // Set the selection mode to multiple and extended.
   listBox1->SelectionMode = SelectionMode::MultiExtended;
   
   // Shutdown the painting of the ListBox as items are added.
   listBox1->BeginUpdate();
   
   // Loop through and add 50 items to the ListBox.
   for ( int x = 1; x <= 50; x++ )
   {
      listBox1->Items->Add( String::Format( "Item {0}", x ) );

   }
   listBox1->EndUpdate();
   
   // Select three items from the ListBox.
   listBox1->SetSelected( 1, true );
   listBox1->SetSelected( 3, true );
   listBox1->SetSelected( 5, true );
   
   #if defined(DEBUG)
   // Display the second selected item in the ListBox to the console.
   System::Diagnostics::Debug::WriteLine( listBox1->SelectedItems[ 1 ] );
   
   // Display the index of the first selected item in the ListBox.
   System::Diagnostics::Debug::WriteLine( listBox1->SelectedIndices[ 0 ] );
   #endif
}

private void button1_Click(object sender, System.EventArgs e)
{
   // Create an instance of the ListBox.
   ListBox listBox1 = new ListBox();
   // Set the size and location of the ListBox.
   listBox1.Size = new System.Drawing.Size(200, 100);
   listBox1.Location = new System.Drawing.Point(10,10);
   // Add the ListBox to the form.
   this.Controls.Add(listBox1);
   // Set the ListBox to display items in multiple columns.
   listBox1.MultiColumn = true;
   // Set the selection mode to multiple and extended.
   listBox1.SelectionMode = SelectionMode.MultiExtended;
 
   // Shutdown the painting of the ListBox as items are added.
   listBox1.BeginUpdate();
   // Loop through and add 50 items to the ListBox.
   for (int x = 1; x <= 50; x++)
   {
      listBox1.Items.Add("Item " + x.ToString());
   }
   // Allow the ListBox to repaint and display the new items.
   listBox1.EndUpdate();
      
   // Select three items from the ListBox.
   listBox1.SetSelected(1, true);
   listBox1.SetSelected(3, true);
   listBox1.SetSelected(5, true);

   // Display the second selected item in the ListBox to the console.
   System.Diagnostics.Debug.WriteLine(listBox1.SelectedItems[1].ToString());
   // Display the index of the first selected item in the ListBox.
   System.Diagnostics.Debug.WriteLine(listBox1.SelectedIndices[0].ToString());             
}

Private Sub button1_Click(sender As Object, e As System.EventArgs)
    ' Create an instance of the ListBox.
    Dim listBox1 As New ListBox()
    ' Set the size and location of the ListBox.
    listBox1.Size = New System.Drawing.Size(200, 100)
    listBox1.Location = New System.Drawing.Point(10, 10)
    ' Add the ListBox to the form.
    Me.Controls.Add(listBox1)
    ' Set the ListBox to display items in multiple columns.
    listBox1.MultiColumn = True
    ' Set the selection mode to multiple and extended.
    listBox1.SelectionMode = SelectionMode.MultiExtended
    
    ' Shutdown the painting of the ListBox as items are added.
    listBox1.BeginUpdate()
    ' Loop through and add 50 items to the ListBox.
    Dim x As Integer
    For x = 1 To 50
        listBox1.Items.Add("Item " & x.ToString())
    Next x
    ' Allow the ListBox to repaint and display the new items.
    listBox1.EndUpdate()
    
    ' Select three items from the ListBox.
    listBox1.SetSelected(1, True)
    listBox1.SetSelected(3, True)
    listBox1.SetSelected(5, True)
       
    ' Display the second selected item in the ListBox to the console.
    System.Diagnostics.Debug.WriteLine(listBox1.SelectedItems(1).ToString())
    ' Display the index of the first selected item in the ListBox.
    System.Diagnostics.Debug.WriteLine(listBox1.SelectedIndices(0).ToString())
End Sub

Remarks

The ListBox control enables you to display a list of items to the user that the user can select by clicking. A ListBox control can provide single or multiple selections using the SelectionMode property. The ListBox also provides the MultiColumn property to enable the display of items in columns instead of a straight vertical list of items. With this, the control can display more visible items and the user no longer needs to scroll to an item.

Typically, Windows handles the task of drawing the items to display in the ListBox. You can use the DrawMode property, and handle the MeasureItem and DrawItem events so you can override the automatic drawing that Windows provides and draw the items yourself. You can use owner-drawn ListBox controls to display variable-height items, images, or a different color or font for the text of each item in the list. The HorizontalExtent property, GetItemHeight, and GetItemRectangle also help you draw your own items.

In addition to display and selection functionality, the ListBox also provides features that enable you to efficiently add items to the ListBox and to find text within the items of the list. The BeginUpdate and EndUpdate methods enable you to add a large number of items to the ListBox without the control being repainted each time an item is added to the list. The FindString and FindStringExact methods enable you to search for an item in the list that contains a specific search string.

The Items, SelectedItems, and SelectedIndices properties provide access to the three collections that are used by the ListBox. The following table outlines the three collections used by the ListBox and their use within the control.

Collection class Use within the ListBox
ListBox.ObjectCollection Contains all items contained in the ListBox control.
ListBox.SelectedObjectCollection Contains a collection of the selected items which is a subset of the items contained in the ListBox control.
ListBox.SelectedIndexCollection Contains a collection of the selected indexes, which is a subset of the indexes of the ListBox.ObjectCollection. These indexes specify items that are selected.

The following three examples show the three indexed collections that the ListBox class supports.

The following table shows an example of how the ListBox.ObjectCollection stores the items of the ListBox as well as their selection state within an example ListBox.

Index Item Selection state within the ListBox
0 object1 Unselected
1 object2 Selected
2 object3 Unselected
3 object4 Selected
4 object5 Selected

Based on the ListBox.ObjectCollection shown in the previous table, this table shows how the ListBox.SelectedObjectCollection would appear.

Index Item
0 object2
1 object4
2 object5

Based on the ListBox.ObjectCollection shown in the previous table, this table shows how the ListBox.SelectedIndexCollection would appear.

Index Index of item
0 1
1 3
2 4

The Add method of the ListBox.ObjectCollection class enables you to add items to the ListBox. The Add method can accept any object when adding a member to the ListBox. When an object is being added to the ListBox, the control uses the text defined in the ToString method of the object unless a member name within the object is specified in the DisplayMember property. In addition to adding items using the Add method of the ListBox.ObjectCollection class you can also add items using the DataSource property of the ListControl class.

Note

If you have a ListBox, ComboBox, or CheckedListBox on a base Windows form and want to modify the string collections of those controls in a derived Windows form, the string collections of those controls in the base Windows form must be empty. If the string collections are not empty, they become read-only when you derive another Windows form.

Constructors

ListBox()

Initializes a new instance of the ListBox class.

Fields

DefaultItemHeight

Specifies the default item height for an owner-drawn ListBox.

NoMatches

Specifies that no matches are found during a search.

Properties

AllowSelection

Gets a value indicating whether the ListBox currently enables selection of list items.

BackColor

Gets or sets the background color for the control.

BackgroundImage

This property is not relevant to this class.

BackgroundImageLayout

Gets or sets the background image layout for a ListBox as defined in the ImageLayout enumeration.

BorderStyle

Gets or sets the type of border that is drawn around the ListBox.

ColumnWidth

Gets or sets the width of columns in a multicolumn ListBox.

CreateParams

Gets the required creation parameters when the control handle is created.

CustomTabOffsets

Gets the width of the tabs between the items in the ListBox.

DefaultSize

Gets the default size of the control.

DrawMode

Gets or sets the drawing mode for the control.

Font

Gets or sets the font of the text displayed by the control.

ForeColor

Gets or sets the foreground color of the control.

HorizontalExtent

Gets or sets the width by which the horizontal scroll bar of a ListBox can scroll.

HorizontalScrollbar

Gets or sets a value indicating whether a horizontal scroll bar is displayed in the control.

IntegralHeight

Gets or sets a value indicating whether the control should resize to avoid showing partial items.

ItemHeight

Gets or sets the height of an item in the ListBox.

Items

Gets the items of the ListBox.

MultiColumn

Gets or sets a value indicating whether the ListBox supports multiple columns.

Padding

This property is not relevant to this class.

PreferredHeight

Gets the combined height of all items in the ListBox.

RightToLeft

Gets or sets a value indicating whether text displayed by the control is displayed from right to left.

ScrollAlwaysVisible

Gets or sets a value indicating whether the vertical scroll bar is shown at all times.

SelectedIndex

Gets or sets the zero-based index of the currently selected item in a ListBox.

SelectedIndices

Gets a collection that contains the zero-based indexes of all currently selected items in the ListBox.

SelectedItem

Gets or sets the currently selected item in the ListBox.

SelectedItems

Gets a collection containing the currently selected items in the ListBox.

SelectionMode

Gets or sets the method in which items are selected in the ListBox.

Sorted

Gets or sets a value indicating whether the items in the ListBox are sorted alphabetically.

Text

Gets or searches for the text of the currently selected item in the ListBox.

TopIndex

Gets or sets the index of the first visible item in the ListBox.

UseCustomTabOffsets

Gets or sets a value indicating whether the ListBox recognizes and expands tab characters when it draws its strings by using the CustomTabOffsets integer array.

UseTabStops

Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings.

Methods

AddItemsCore(Object[])

This member is obsolete, and there is no replacement.

BeginUpdate()

Maintains performance while items are added to the ListBox one at a time by preventing the control from drawing until the EndUpdate() method is called.

ClearSelected()

Unselects all items in the ListBox.

CreateItemCollection()

Creates a new instance of the item collection.

EndUpdate()

Resumes painting the ListBox control after painting is suspended by the BeginUpdate() method.

FindString(String, Int32)

Finds the first item in the ListBox that starts with the specified string. The search starts at a specific starting index.

FindString(String)

Finds the first item in the ListBox that starts with the specified string.

FindStringExact(String)

Finds the first item in the ListBox that exactly matches the specified string.

FindStringExact(String, Int32)

Finds the first item in the ListBox that exactly matches the specified string. The search starts at a specific starting index.

GetItemHeight(Int32)

Returns the height of an item in the ListBox.

GetItemRectangle(Int32)

Returns the bounding rectangle for an item in the ListBox.

GetScaledBounds(Rectangle, SizeF, BoundsSpecified)

Retrieves the bounds within which the ListBox is scaled.

GetSelected(Int32)

Returns a value indicating whether the specified item is selected.

IndexFromPoint(Point)

Returns the zero-based index of the item at the specified coordinates.

IndexFromPoint(Int32, Int32)

Returns the zero-based index of the item at the specified coordinates.

OnChangeUICues(UICuesEventArgs)

Raises the ChangeUICues event.

OnDataSourceChanged(EventArgs)

Raises the DataSourceChanged event.

OnDisplayMemberChanged(EventArgs)

Raises the DisplayMemberChanged event.

OnDrawItem(DrawItemEventArgs)

Raises the DrawItem event.

OnFontChanged(EventArgs)

Raises the FontChanged event.

OnHandleCreated(EventArgs)

Specifies when the window handle has been created so that column width and other characteristics can be set. Inheriting classes should call base.OnHandleCreated.

OnHandleDestroyed(EventArgs)

Overridden to be sure that items are set up and cleared out correctly. Inheriting controls should call base.OnHandleDestroyed.

OnMeasureItem(MeasureItemEventArgs)

Raises the MeasureItem event.

OnParentChanged(EventArgs)

Raises the ParentChanged event.

OnResize(EventArgs)

Raises the Resize event.

OnSelectedIndexChanged(EventArgs)

Raises the SelectedValueChanged event.

OnSelectedValueChanged(EventArgs)

Raises the SelectedValueChanged event.

Refresh()

Forces the control to invalidate its client area and immediately redraw itself and any child controls.

RefreshItem(Int32)

Refreshes the item contained at the specified index.

RefreshItems()

Refreshes all ListBox items and retrieves new strings for them.

RescaleConstantsForDpi(Int32, Int32)

Provides constants for rescaling the control when a DPI change occurs.

ResetBackColor()

Resets the BackColor property to its default value.

ResetForeColor()

Resets the ForeColor property to its default value.

ScaleControl(SizeF, BoundsSpecified)

Scales a control's location, size, padding and margin.

SetBoundsCore(Int32, Int32, Int32, Int32, BoundsSpecified)

Sets the specified bounds of the ListBox control.

SetItemCore(Int32, Object)

Sets the object with the specified index in the derived class.

SetItemsCore(IList)

Clears the contents of the ListBox and adds the specified items to the control.

SetSelected(Int32, Boolean)

Selects or clears the selection for the specified item in a ListBox.

Sort()

Sorts the items in the ListBox.

ToString()

Returns a string representation of the ListBox.

WmReflectCommand(Message)

Processes the command message the ListView control receives from the top-level window.

WndProc(Message)

The list's window procedure.

Container Inherited from Component
DesignMode Inherited from Component
Dispose() Inherited from Component
Disposed Inherited from Component
Events Inherited from Component
GetService(Type) Inherited from Component
CreateObjRef(Type) Inherited from MarshalByRefObject
GetLifetimeService() Inherited from MarshalByRefObject
InitializeLifetimeService() Inherited from MarshalByRefObject
MemberwiseClone(Boolean) Inherited from MarshalByRefObject
Equals(Object) Inherited from Object
Equals(Object, Object) Inherited from Object
GetHashCode() Inherited from Object
GetType() Inherited from Object
MemberwiseClone() Inherited from Object
ReferenceEquals(Object, Object) Inherited from Object
AccessibilityNotifyClients(AccessibleEvents, Int32) Inherited from Control
AccessibilityNotifyClients(AccessibleEvents, Int32, Int32) Inherited from Control
AccessibilityObject Inherited from Control
AccessibleDefaultActionDescription Inherited from Control
AccessibleDescription Inherited from Control
AccessibleName Inherited from Control
AccessibleRole Inherited from Control
AllowDrop Inherited from Control
Anchor Inherited from Control
AutoScrollOffset Inherited from Control
AutoSize Inherited from Control
AutoSizeChanged Inherited from Control
BackColorChanged Inherited from Control
BeginInvoke(Delegate) Inherited from Control
BeginInvoke(Delegate, Object[]) Inherited from Control
BindingContext Inherited from Control
BindingContextChanged Inherited from Control
Bottom Inherited from Control
Bounds Inherited from Control
BringToFront() Inherited from Control
CanEnableIme Inherited from Control
CanFocus Inherited from Control
CanRaiseEvents Inherited from Control
CanSelect Inherited from Control
Capture Inherited from Control
CausesValidation Inherited from Control
CausesValidationChanged Inherited from Control
ChangeUICues Inherited from Control
CheckForIllegalCrossThreadCalls Inherited from Control
ClientRectangle Inherited from Control
ClientSize Inherited from Control
ClientSizeChanged Inherited from Control
CompanyName Inherited from Control
Contains(Control) Inherited from Control
ContainsFocus Inherited from Control
ContextMenu Inherited from Control
ContextMenuChanged Inherited from Control
ContextMenuStrip Inherited from Control
ContextMenuStripChanged Inherited from Control
ControlAdded Inherited from Control
ControlRemoved Inherited from Control
Controls Inherited from Control
CreateAccessibilityInstance() Inherited from Control
CreateControl() Inherited from Control
CreateControlsInstance() Inherited from Control
Created Inherited from Control
CreateGraphics() Inherited from Control
CreateHandle() Inherited from Control
Cursor Inherited from Control
CursorChanged Inherited from Control
DataBindings Inherited from Control
DefaultBackColor Inherited from Control
DefaultCursor Inherited from Control
DefaultFont Inherited from Control
DefaultForeColor Inherited from Control
DefaultImeMode Inherited from Control
DefaultMargin Inherited from Control
DefaultMaximumSize Inherited from Control
DefaultMinimumSize Inherited from Control
DefaultPadding Inherited from Control
DefWndProc(Message) Inherited from Control
DestroyHandle() Inherited from Control
DeviceDpi Inherited from Control
DisplayRectangle Inherited from Control
Dispose(Boolean) Inherited from Control
Disposing Inherited from Control
Dock Inherited from Control
DockChanged Inherited from Control
DoDragDrop(Object, DragDropEffects) Inherited from Control
DoubleBuffered Inherited from Control
DoubleClick Inherited from Control
DpiChangedAfterParent Inherited from Control
DpiChangedBeforeParent Inherited from Control
DragDrop Inherited from Control
DragEnter Inherited from Control
DragLeave Inherited from Control
DragOver Inherited from Control
DrawToBitmap(Bitmap, Rectangle) Inherited from Control
Enabled Inherited from Control
EnabledChanged Inherited from Control
EndInvoke(IAsyncResult) Inherited from Control
Enter Inherited from Control
FindForm() Inherited from Control
Focus() Inherited from Control
Focused Inherited from Control
FontChanged Inherited from Control
FontHeight Inherited from Control
ForeColorChanged Inherited from Control
FromChildHandle(IntPtr) Inherited from Control
FromHandle(IntPtr) Inherited from Control
GetAccessibilityObjectById(Int32) Inherited from Control
GetAutoSizeMode() Inherited from Control
GetChildAtPoint(Point) Inherited from Control
GetChildAtPoint(Point, GetChildAtPointSkip) Inherited from Control
GetContainerControl() Inherited from Control
GetNextControl(Control, Boolean) Inherited from Control
GetPreferredSize(Size) Inherited from Control
GetStyle(ControlStyles) Inherited from Control
GetTopLevel() Inherited from Control
GiveFeedback Inherited from Control
GotFocus Inherited from Control
Handle Inherited from Control
HandleCreated Inherited from Control
HandleDestroyed Inherited from Control
HasChildren Inherited from Control
Height Inherited from Control
HelpRequested Inherited from Control
Hide() Inherited from Control
ImeMode Inherited from Control
ImeModeBase Inherited from Control
ImeModeChanged Inherited from Control
InitLayout() Inherited from Control
Invalidate() Inherited from Control
Invalidate(Boolean) Inherited from Control
Invalidate(Rectangle) Inherited from Control
Invalidate(Rectangle, Boolean) Inherited from Control
Invalidate(Region) Inherited from Control
Invalidate(Region, Boolean) Inherited from Control
Invalidated Inherited from Control
Invoke(Delegate) Inherited from Control
Invoke(Delegate, Object[]) Inherited from Control
InvokeGotFocus(Control, EventArgs) Inherited from Control
InvokeLostFocus(Control, EventArgs) Inherited from Control
InvokeOnClick(Control, EventArgs) Inherited from Control
InvokePaint(Control, PaintEventArgs) Inherited from Control
InvokePaintBackground(Control, PaintEventArgs) Inherited from Control
InvokeRequired Inherited from Control
IsAccessible Inherited from Control
IsDisposed Inherited from Control
IsHandleCreated Inherited from Control
IsInputChar(Char) Inherited from Control
IsKeyLocked(Keys) Inherited from Control
IsMirrored Inherited from Control
IsMnemonic(Char, String) Inherited from Control
KeyDown Inherited from Control
KeyPress Inherited from Control
KeyUp Inherited from Control
Layout Inherited from Control
LayoutEngine Inherited from Control
Leave Inherited from Control
Left Inherited from Control
Location Inherited from Control
LocationChanged Inherited from Control
LogicalToDeviceUnits(Int32) Inherited from Control
LostFocus Inherited from Control
Margin Inherited from Control
MarginChanged Inherited from Control
MaximumSize Inherited from Control
MinimumSize Inherited from Control
ModifierKeys Inherited from Control
MouseButtons Inherited from Control
MouseCaptureChanged Inherited from Control
MouseDoubleClick Inherited from Control
MouseDown Inherited from Control
MouseEnter Inherited from Control
MouseHover Inherited from Control
MouseLeave Inherited from Control
MouseMove Inherited from Control
MousePosition Inherited from Control
MouseUp Inherited from Control
MouseWheel Inherited from Control
Move Inherited from Control
Name Inherited from Control
NotifyInvalidate(Rectangle) Inherited from Control
OnAutoSizeChanged(EventArgs) Inherited from Control
OnBackColorChanged(EventArgs) Inherited from Control
OnBackgroundImageChanged(EventArgs) Inherited from Control
OnBackgroundImageLayoutChanged(EventArgs) Inherited from Control
OnCausesValidationChanged(EventArgs) Inherited from Control
OnClick(EventArgs) Inherited from Control
OnClientSizeChanged(EventArgs) Inherited from Control
OnContextMenuChanged(EventArgs) Inherited from Control
OnContextMenuStripChanged(EventArgs) Inherited from Control
OnControlAdded(ControlEventArgs) Inherited from Control
OnControlRemoved(ControlEventArgs) Inherited from Control
OnCreateControl() Inherited from Control
OnCursorChanged(EventArgs) Inherited from Control
OnDockChanged(EventArgs) Inherited from Control
OnDoubleClick(EventArgs) Inherited from Control
OnDpiChangedAfterParent(EventArgs) Inherited from Control
OnDpiChangedBeforeParent(EventArgs) Inherited from Control
OnDragDrop(DragEventArgs) Inherited from Control
OnDragEnter(DragEventArgs) Inherited from Control
OnDragLeave(EventArgs) Inherited from Control
OnDragOver(DragEventArgs) Inherited from Control
OnEnabledChanged(EventArgs) Inherited from Control
OnEnter(EventArgs) Inherited from Control
OnForeColorChanged(EventArgs) Inherited from Control
OnGiveFeedback(GiveFeedbackEventArgs) Inherited from Control
OnGotFocus(EventArgs) Inherited from Control
OnHelpRequested(HelpEventArgs) Inherited from Control
OnImeModeChanged(EventArgs) Inherited from Control
OnInvalidated(InvalidateEventArgs) Inherited from Control
OnKeyDown(KeyEventArgs) Inherited from Control
OnKeyPress(KeyPressEventArgs) Inherited from Control
OnKeyUp(KeyEventArgs) Inherited from Control
OnLayout(LayoutEventArgs) Inherited from Control
OnLeave(EventArgs) Inherited from Control
OnLocationChanged(EventArgs) Inherited from Control
OnLostFocus(EventArgs) Inherited from Control
OnMarginChanged(EventArgs) Inherited from Control
OnMouseCaptureChanged(EventArgs) Inherited from Control
OnMouseClick(MouseEventArgs) Inherited from Control
OnMouseDoubleClick(MouseEventArgs) Inherited from Control
OnMouseDown(MouseEventArgs) Inherited from Control
OnMouseEnter(EventArgs) Inherited from Control
OnMouseHover(EventArgs) Inherited from Control
OnMouseLeave(EventArgs) Inherited from Control
OnMouseMove(MouseEventArgs) Inherited from Control
OnMouseUp(MouseEventArgs) Inherited from Control
OnMouseWheel(MouseEventArgs) Inherited from Control
OnMove(EventArgs) Inherited from Control
OnNotifyMessage(Message) Inherited from Control
OnPaddingChanged(EventArgs) Inherited from Control
OnPaint(PaintEventArgs) Inherited from Control
OnPaintBackground(PaintEventArgs) Inherited from Control
OnParentBackColorChanged(EventArgs) Inherited from Control
OnParentBackgroundImageChanged(EventArgs) Inherited from Control
OnParentBindingContextChanged(EventArgs) Inherited from Control
OnParentCursorChanged(EventArgs) Inherited from Control
OnParentEnabledChanged(EventArgs) Inherited from Control
OnParentFontChanged(EventArgs) Inherited from Control
OnParentForeColorChanged(EventArgs) Inherited from Control
OnParentRightToLeftChanged(EventArgs) Inherited from Control
OnParentVisibleChanged(EventArgs) Inherited from Control
OnPreviewKeyDown(PreviewKeyDownEventArgs) Inherited from Control
OnPrint(PaintEventArgs) Inherited from Control
OnQueryContinueDrag(QueryContinueDragEventArgs) Inherited from Control
OnRegionChanged(EventArgs) Inherited from Control
OnRightToLeftChanged(EventArgs) Inherited from Control
OnSizeChanged(EventArgs) Inherited from Control
OnStyleChanged(EventArgs) Inherited from Control
OnSystemColorsChanged(EventArgs) Inherited from Control
OnTabIndexChanged(EventArgs) Inherited from Control
OnTabStopChanged(EventArgs) Inherited from Control
OnTextChanged(EventArgs) Inherited from Control
OnValidated(EventArgs) Inherited from Control
OnValidating(CancelEventArgs) Inherited from Control
OnVisibleChanged(EventArgs) Inherited from Control
Parent Inherited from Control
ParentChanged Inherited from Control
PerformLayout() Inherited from Control
PerformLayout(Control, String) Inherited from Control
PointToClient(Point) Inherited from Control
PointToScreen(Point) Inherited from Control
PreferredSize Inherited from Control
PreProcessControlMessage(Message) Inherited from Control
PreProcessMessage(Message) Inherited from Control
PreviewKeyDown Inherited from Control
ProcessCmdKey(Message, Keys) Inherited from Control
ProcessDialogChar(Char) Inherited from Control
ProcessDialogKey(Keys) Inherited from Control
ProcessKeyEventArgs(Message) Inherited from Control
ProcessKeyMessage(Message) Inherited from Control
ProcessKeyPreview(Message) Inherited from Control
ProcessMnemonic(Char) Inherited from Control
ProductName Inherited from Control
ProductVersion Inherited from Control
PropagatingImeMode Inherited from Control
QueryAccessibilityHelp Inherited from Control
QueryContinueDrag Inherited from Control
RaiseDragEvent(Object, DragEventArgs) Inherited from Control
RaiseKeyEvent(Object, KeyEventArgs) Inherited from Control
RaiseMouseEvent(Object, MouseEventArgs) Inherited from Control
RaisePaintEvent(Object, PaintEventArgs) Inherited from Control
RecreateHandle() Inherited from Control
RecreatingHandle Inherited from Control
RectangleToClient(Rectangle) Inherited from Control
RectangleToScreen(Rectangle) Inherited from Control
ReflectMessage(IntPtr, Message) Inherited from Control
Region Inherited from Control
RegionChanged Inherited from Control
RenderRightToLeft Inherited from Control
ResetBindings() Inherited from Control
ResetCursor() Inherited from Control
ResetFont() Inherited from Control
ResetImeMode() Inherited from Control
ResetMouseEventArgs() Inherited from Control
ResetRightToLeft() Inherited from Control
ResetText() Inherited from Control
Resize Inherited from Control
ResizeRedraw Inherited from Control
ResumeLayout() Inherited from Control
ResumeLayout(Boolean) Inherited from Control
Right Inherited from Control
RightToLeftChanged Inherited from Control
RtlTranslateAlignment(ContentAlignment) Inherited from Control
RtlTranslateAlignment(HorizontalAlignment) Inherited from Control
RtlTranslateAlignment(LeftRightAlignment) Inherited from Control
RtlTranslateContent(ContentAlignment) Inherited from Control
RtlTranslateHorizontal(HorizontalAlignment) Inherited from Control
RtlTranslateLeftRight(LeftRightAlignment) Inherited from Control
Scale(SizeF) Inherited from Control
Scale(Single) Inherited from Control
Scale(Single, Single) Inherited from Control
ScaleBitmapLogicalToDevice(Bitmap) Inherited from Control
ScaleChildren Inherited from Control
ScaleCore(Single, Single) Inherited from Control
Select() Inherited from Control
Select(Boolean, Boolean) Inherited from Control
SelectNextControl(Control, Boolean, Boolean, Boolean, Boolean) Inherited from Control
SendToBack() Inherited from Control
SetAutoSizeMode(AutoSizeMode) Inherited from Control
SetBounds(Int32, Int32, Int32, Int32) Inherited from Control
SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) Inherited from Control
SetClientSizeCore(Int32, Int32) Inherited from Control
SetStyle(ControlStyles, Boolean) Inherited from Control
SetTopLevel(Boolean) Inherited from Control
SetVisibleCore(Boolean) Inherited from Control
Show() Inherited from Control
ShowFocusCues Inherited from Control
ShowKeyboardCues Inherited from Control
Site Inherited from Control
Size Inherited from Control
SizeChanged Inherited from Control
SizeFromClientSize(Size) Inherited from Control
StyleChanged Inherited from Control
SuspendLayout() Inherited from Control
IDropTarget.OnDragDrop(DragEventArgs) Inherited from Control
IDropTarget.OnDragEnter(DragEventArgs) Inherited from Control
IDropTarget.OnDragLeave(EventArgs) Inherited from Control
IDropTarget.OnDragOver(DragEventArgs) Inherited from Control
SystemColorsChanged Inherited from Control
TabIndex Inherited from Control
TabIndexChanged Inherited from Control
TabStop Inherited from Control
TabStopChanged Inherited from Control
Tag Inherited from Control
Top Inherited from Control
TopLevelControl Inherited from Control
Update() Inherited from Control
UpdateBounds() Inherited from Control
UpdateBounds(Int32, Int32, Int32, Int32) Inherited from Control
UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32) Inherited from Control
UpdateStyles() Inherited from Control
UpdateZOrder() Inherited from Control
UseWaitCursor Inherited from Control
Validated Inherited from Control
Validating Inherited from Control
Visible Inherited from Control
VisibleChanged Inherited from Control
Width Inherited from Control
WindowTarget Inherited from Control
DataManager Inherited from ListControl
DataSource Inherited from ListControl
DataSourceChanged Inherited from ListControl
DisplayMember Inherited from ListControl
DisplayMemberChanged Inherited from ListControl
FilterItemOnProperty(Object) Inherited from ListControl
FilterItemOnProperty(Object, String) Inherited from ListControl
Format Inherited from ListControl
FormatInfo Inherited from ListControl
FormatInfoChanged Inherited from ListControl
FormatString Inherited from ListControl
FormatStringChanged Inherited from ListControl
FormattingEnabled Inherited from ListControl
FormattingEnabledChanged Inherited from ListControl
GetItemText(Object) Inherited from ListControl
IsInputKey(Keys) Inherited from ListControl
OnBindingContextChanged(EventArgs) Inherited from ListControl
OnFormat(ListControlConvertEventArgs) Inherited from ListControl
OnFormatInfoChanged(EventArgs) Inherited from ListControl
OnFormatStringChanged(EventArgs) Inherited from ListControl
OnFormattingEnabledChanged(EventArgs) Inherited from ListControl
OnValueMemberChanged(EventArgs) Inherited from ListControl
SelectedValue Inherited from ListControl
SelectedValueChanged Inherited from ListControl
ValueMember Inherited from ListControl
ValueMemberChanged Inherited from ListControl

Events

BackgroundImageChanged

Occurs when the BackgroundImage property of the label changes.

BackgroundImageLayoutChanged

Occurs when the BackgroundImageLayout property changes.

Click

Occurs when the ListBox control is clicked.

DrawItem

Occurs when a visual aspect of an owner-drawn ListBox changes.

MeasureItem

Occurs when an owner-drawn ListBox is created and the sizes of the list items are determined.

MouseClick

Occurs when the user clicks the ListBox control with the mouse pointer.

PaddingChanged

Occurs when the value of the Padding property changes.

Paint

Occurs when the ListBox control is painted.

SelectedIndexChanged

Occurs when the SelectedIndex property or the SelectedIndices collection has changed.

TextChanged

Occurs when the Text property is changed.

Applies to