System.Windows.Forms.ComboBox Members

The members of System.Windows.Forms.ComboBox are listed below.

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

Public Constructors

Initializes a new instance of the System.Windows.Forms.ComboBox class.

Public Properties

AutoCompleteCustomSourceAutoCompleteStringCollection.

Gets or sets a custom System.Collections.Specialized.StringCollection to use when the ComboBox.AutoCompleteSource property is set to CustomSource.

AutoCompleteModeAutoCompleteMode.

Gets or sets an option that controls how automatic completion works for the System.Windows.Forms.ComboBox.

AutoCompleteSourceAutoCompleteSource.

Gets or sets a value specifying the source of complete strings used for automatic completion.

override
BackColorSystem.Drawing.Color.

Gets or sets the background color for the control.

override
BackgroundImageSystem.Drawing.Image.

This property is not relevant to this class.

override
BackgroundImageLayoutImageLayout.

Gets or sets the background image layout as defined in the System.Windows.Forms.ImageLayout enumeration.

DataSourceobject.

Gets or sets the data source for this System.Windows.Forms.ComboBox.

DrawModeDrawMode.

Gets or sets a value indicating whether your code or the operating system will handle drawing of elements in the list.

DropDownHeightint.

Gets or sets the height in pixels of the drop-down portion of the System.Windows.Forms.ComboBox.

DropDownStyleComboBoxStyle.

Gets or sets a value specifying the style of the combo box.

DropDownWidthint.

Gets or sets the width of the of the drop-down portion of a combo box.

DroppedDownbool.

Gets or sets a value indicating whether the combo box is displaying its drop-down portion.

FlatStyleFlatStyle.

Gets or sets the appearance of the System.Windows.Forms.ComboBox.

[read-only]
override
Focusedbool.

Gets a value indicating whether the System.Windows.Forms.ComboBox has focus.

override
ForeColorSystem.Drawing.Color.

Gets or sets the foreground color of the control.

IntegralHeightbool.

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

ItemHeightint.

Gets or sets the height of an item in the combo box.

[read-only]
ItemsComboBox.ObjectCollection.

Gets an object representing the collection of the items contained in this System.Windows.Forms.ComboBox.

MaxDropDownItemsint.

Gets or sets the maximum number of items to be shown in the drop-down portion of the System.Windows.Forms.ComboBox.

override
MaximumSizeSystem.Drawing.Size.

Gets or sets the size that is the upper limit that Control.GetPreferredSize(System.Drawing.Size) can specify.

MaxLengthint.

Gets or sets the number of characters a user can type into the System.Windows.Forms.ComboBox.

override
MinimumSizeSystem.Drawing.Size.

Gets or sets the size that is the lower limit that Control.GetPreferredSize(System.Drawing.Size) can specify.

PaddingPadding.

This property is not relevant for this class.

[read-only]
PreferredHeightint.

Gets the preferred height of the System.Windows.Forms.ComboBox.

override
SelectedIndexint.

Gets or sets the index specifying the currently selected item.

SelectedItemobject.

Gets or sets currently selected item in the System.Windows.Forms.ComboBox.

SelectedTextstring.

Gets or sets the text that is selected in the editable portion of a System.Windows.Forms.ComboBox.

SelectionLengthint.

Gets or sets the number of characters selected in the editable portion of the combo box.

SelectionStartint.

Gets or sets the starting index of text selected in the combo box.

Sortedbool.

Gets or sets a value indicating whether the items in the combo box are sorted.

override
Textstring.

Gets or sets the text associated with this control.

Protected Properties

[read-only]
override
CreateParamsCreateParams.

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

[read-only]
override
DefaultSizeSystem.Drawing.Size.

Gets the default size of the control.

Public Methods

BeginUpdate()

Maintains performance when items are added to the System.Windows.Forms.ComboBox one at a time.

EndUpdate()

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

FindString(string) : int

Returns the index of the first item in the System.Windows.Forms.ComboBox that starts with the specified string.

FindString(string, int) : int

Returns the index of the first item in the System.Windows.Forms.ComboBox beyond the specified index that contains the specified string. The search is not case sensitive.

FindStringExact(string) : int

Finds the first item in the combo box that matches the specified string.

FindStringExact(string, int) : int

Finds the first item after the specified index that matches the specified string.

GetItemHeight(int) : int

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

override
ResetText()

Resets the Control.Text property to its default value.

Select(int, int)

Selects a range of text in the editable portion of the System.Windows.Forms.ComboBox.

SelectAll()

Selects all the text in the editable portion of the System.Windows.Forms.ComboBox.

override
ToString() : string

Returns a string that represents the System.Windows.Forms.ComboBox control.

Protected Methods

AddItemsCore(object[])

Adds the specified items to the combo box.

override
CreateAccessibilityInstance() : AccessibleObject

Creates a new accessibility object for the control.

override
CreateHandle()

Creates a handle for the control.

override
Dispose(bool)

Releases the unmanaged resources used by the System.Windows.Forms.ComboBox and optionally releases the managed resources.

override
IsInputKey(Keys) : bool

Determines whether the specified key is a regular input key or a special key that requires preprocessing.

override
OnBackColorChanged(EventArgs)

Raises the Control.BackColorChanged event.

override
OnDataSourceChanged(EventArgs)

Raises the ListControl.DataSourceChanged event.

override
OnDisplayMemberChanged(EventArgs)

Raises the ListControl.DisplayMemberChanged event.

OnDrawItem(DrawItemEventArgs)

Raises the ComboBox.DrawItem event.

OnDropDown(EventArgs)

Raises the ComboBox.DropDown event.

OnDropDownClosed(EventArgs)

Raises the ComboBox.DropDownClosed event.

OnDropDownStyleChanged(EventArgs)

Raises the ComboBox.DropDownStyleChanged event.

override
OnFontChanged(EventArgs)

Raises the Control.FontChanged event.

override
OnForeColorChanged(EventArgs)

Raises the Control.ForeColorChanged event.

override
OnGotFocus(EventArgs)

Raises the Control.GotFocus event.

override
OnHandleCreated(EventArgs)

Raises the Control.HandleCreated event.

override
OnHandleDestroyed(EventArgs)

Raises the Control.HandleDestroyed event.

override
OnKeyDown(KeyEventArgs)

Raises the Control.KeyDown event.

override
OnKeyPress(KeyPressEventArgs)

Raises the Control.KeyPress event.

override
OnLostFocus(EventArgs)

Raises the Control.LostFocus event.

OnMeasureItem(MeasureItemEventArgs)

Raises the ComboBox.MeasureItem event.

override
OnMouseEnter(EventArgs)

Raises the Control.MouseEnter event.

override
OnMouseLeave(EventArgs)

Raises the Control.MouseLeave event.

override
OnParentBackColorChanged(EventArgs)

Raises the Control.BackColorChanged event.

override
OnResize(EventArgs)

Raises the Control.Resize event.

override
OnSelectedIndexChanged(EventArgs)

Raises the ComboBox.SelectedIndexChanged event.

OnSelectedItemChanged(EventArgs)

Raises the DomainUpDown.SelectedItemChanged event.

override
OnSelectedValueChanged(EventArgs)

Raises the ListControl.SelectedValueChanged event.

OnSelectionChangeCommitted(EventArgs)

Raises the ComboBox.SelectionChangeCommitted event.

override
OnTextChanged(EventArgs)

Raises the Control.TextChanged event.

OnTextUpdate(EventArgs)

Raises the ComboBox.TextUpdate event.

override
OnValidating(System.ComponentModel.CancelEventArgs)

Raises the Control.Validating event.

override
ProcessKeyEventArgs(ref Message) : bool
Documentation for this section has not yet been entered.
override
RefreshItem(int)

Refreshes the item contained at the specified location.

override
RefreshItems()

Refreshes all System.Windows.Forms.ComboBox items.

override
ScaleControl(System.Drawing.SizeF, BoundsSpecified)

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

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

Sets the size and location of the System.Windows.Forms.ComboBox.

override
SetItemCore(int, object)

When overridden in a derived class, sets the object with the specified index in the derived class.

override
SetItemsCore(IList)

When overridden in a derived class, sets the specified array of objects in a collection in the derived class.

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

Public Events

BackgroundImageChanged

Occurs when the value of the ComboBox.BackgroundImage property changes.

BackgroundImageLayoutChanged

Occurs when the ComboBox.BackgroundImageLayout property changes.

DoubleClick

This event is not relevant for this class.

DrawItem

Occurs when a visual aspect of an owner-drawn System.Windows.Forms.ComboBox changes.

DropDown

Occurs when the drop-down portion of a System.Windows.Forms.ComboBox is shown.

DropDownClosed

Occurs when the drop-down portion of the System.Windows.Forms.ComboBox is no longer visible.

DropDownStyleChanged

Occurs when the ComboBox.DropDownStyle property has changed.

MeasureItem

Occurs each time an owner-drawn System.Windows.Forms.ComboBox item needs to be drawn and when the sizes of the list items are determined.

PaddingChanged

This event is not relevant to this class.

Paint

Occurs when the System.Windows.Forms.ComboBox control is redrawn.

SelectedIndexChanged

Occurs when the ComboBox.SelectedIndex property has changed.

SelectionChangeCommitted

Occurs when the selected item has changed and that change is displayed in the System.Windows.Forms.ComboBox.

TextUpdate

Occurs when the control has formatted the text, but before the text is displayed.