System.Windows.Forms.ListBox: Method Members

The methods of System.Windows.Forms.ListBox are listed below. For a list of all members, see the ListBox Members list.

See Also: Inherited members from System.Windows.Forms.ListControl

Public Methods

BeginUpdate()

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

ClearSelected()

Unselects all items in the System.Windows.Forms.ListBox.

EndUpdate()

Resumes painting the System.Windows.Forms.ListBox control after painting is suspended by the ListBox.BeginUpdate method.

FindString(string) : int

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

FindString(string, int) : int

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

FindStringExact(string) : int

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

FindStringExact(string, int) : int

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

GetItemHeight(int) : int

Returns the height of an item in the System.Windows.Forms.ListBox.

GetItemRectangle(int) : System.Drawing.Rectangle

Returns the bounding rectangle for an item in the System.Windows.Forms.ListBox.

GetSelected(int) : bool

Returns a value indicating whether the specified item is selected.

IndexFromPoint(System.Drawing.Point) : int

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

IndexFromPoint(int, int) : int

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

override
Refresh()

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

override
ResetBackColor()

Resets the Control.BackColor property to its default value.

override
ResetForeColor()

Resets the Control.ForeColor property to its default value.

SetSelected(int, bool)

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

override
ToString() : string

Returns a string representation of the System.Windows.Forms.ListBox.

Protected Methods

AddItemsCore(object[])

This member is obsolete, and there is no replacement.

CreateItemCollection() : ListBox.ObjectCollection

Creates a new instance of the item collection.

override
GetScaledBounds(System.Drawing.Rectangle, System.Drawing.SizeF, BoundsSpecified) : System.Drawing.Rectangle

Retrieves the bounds within which the System.Windows.Forms.ListBox is scaled.

override
OnChangeUICues(UICuesEventArgs)

Raises the Control.ChangeUICues event.

override
OnDataSourceChanged(EventArgs)

Raises the ListControl.DataSourceChanged event.

override
OnDisplayMemberChanged(EventArgs)

Raises the ListControl.DisplayMemberChanged event.

OnDrawItem(DrawItemEventArgs)

Raises the ListBox.DrawItem event.

override
OnFontChanged(EventArgs)

Raises the Control.FontChanged event.

override
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.

override
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 ListBox.MeasureItem event.

override
OnParentChanged(EventArgs)

Raises the Control.ParentChanged event.

override
OnResize(EventArgs)

Raises the Control.Resize event.

override
OnSelectedIndexChanged(EventArgs)

Raises the ListControl.SelectedValueChanged event.

override
OnSelectedValueChanged(EventArgs)

Raises the ListControl.SelectedValueChanged event.

override
RefreshItem(int)

Refreshes the item contained at the specified index.

override
RefreshItems()

Refreshes all System.Windows.Forms.ListBox items and retrieves new strings for them.

override
ScaleControl(System.Drawing.SizeF, BoundsSpecified)

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

override
SetBoundsCore(int, int, int, int, BoundsSpecified)

Sets the specified bounds of the System.Windows.Forms.ListBox control.

override
SetItemCore(int, object)

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

override
SetItemsCore(IList)

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

Sort()

Sorts the items in the System.Windows.Forms.ListBox.

WmReflectCommand(ref Message)
Documentation for this section has not yet been entered.
override
WndProc(ref Message)
Documentation for this section has not yet been entered.