ComboBox Class

Definition

Represents a Windows combo box control.

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

Examples

The following code example is a complete application showing how you can use the Add method to add items to a ComboBox, the FindString method to find items in a ComboBox, and the BeginUpdate and EndUpdate methods to efficiently add a large number items to a ComboBox. The ability to store values that are different from displayed text is inherited from ListControl. For an example of how to use this feature, see the ListControl class.

You must add references to the System.Drawing and System.Windows.Forms namespaces to run this example.

#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>

using namespace System;
using namespace System::Windows::Forms;

namespace Win32Form1Namespace
{
   public ref class Win32Form1: public System::Windows::Forms::Form
   {
   private:
      System::Windows::Forms::Button^ addButton;
      System::Windows::Forms::TextBox^ textBox2;
      System::Windows::Forms::Button^ addGrandButton;
      System::Windows::Forms::ComboBox^ comboBox1;
      System::Windows::Forms::Button^ showSelectedButton;
      System::Windows::Forms::TextBox^ textBox1;
      System::Windows::Forms::Button^ findButton;
      System::Windows::Forms::Label ^ label1;

   public:
      Win32Form1()
      {
         this->InitializeComponent();
      }

   private:
      void InitializeComponent()
      {
         this->addButton = gcnew System::Windows::Forms::Button;
         this->textBox2 = gcnew System::Windows::Forms::TextBox;
         this->addGrandButton = gcnew System::Windows::Forms::Button;
         this->comboBox1 = gcnew System::Windows::Forms::ComboBox;
         this->showSelectedButton = gcnew System::Windows::Forms::Button;
         this->textBox1 = gcnew System::Windows::Forms::TextBox;
         this->findButton = gcnew System::Windows::Forms::Button;
         this->label1 = gcnew System::Windows::Forms::Label;
         this->addButton->Location = System::Drawing::Point( 248, 32 );
         this->addButton->Size = System::Drawing::Size( 40, 24 );
         this->addButton->TabIndex = 1;
         this->addButton->Text = "Add";
         this->addButton->Click += gcnew System::EventHandler(
            this, &Win32Form1::addButton_Click );
         this->textBox2->Location = System::Drawing::Point( 8, 64 );
         this->textBox2->Size = System::Drawing::Size( 232, 20 );
         this->textBox2->TabIndex = 6;
         this->textBox2->Text = "";
         this->addGrandButton->Location = System::Drawing::Point( 8, 96 );
         this->addGrandButton->Size = System::Drawing::Size( 280, 23 );
         this->addGrandButton->TabIndex = 2;
         this->addGrandButton->Text = "Add 1, 000 Items";
         this->addGrandButton->Click += gcnew System::EventHandler(
            this, &Win32Form1::addGrandButton_Click );
         this->comboBox1->Anchor = (System::Windows::Forms::AnchorStyles)(
            (System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left) |
             System::Windows::Forms::AnchorStyles::Right);
         this->comboBox1->DropDownWidth = 280;
         array<Object^>^ objectArray = {"Item 1",
            "Item 2",
            "Item 3",
            "Item 4",
            "Item 5"};
         this->comboBox1->Items->AddRange( objectArray );
         this->comboBox1->Location = System::Drawing::Point( 8, 248 );
         this->comboBox1->Size = System::Drawing::Size( 280, 21 );
         this->comboBox1->TabIndex = 7;
         this->showSelectedButton->Location = System::Drawing::Point( 8, 128 );
         this->showSelectedButton->Size = System::Drawing::Size( 280, 24 );
         this->showSelectedButton->TabIndex = 4;
         this->showSelectedButton->Text = "What Item is Selected?";
         this->showSelectedButton->Click += gcnew System::EventHandler( 
            this, &Win32Form1::showSelectedButton_Click );
         this->textBox1->Location = System::Drawing::Point( 8, 32 );
         this->textBox1->Size = System::Drawing::Size( 232, 20 );
         this->textBox1->TabIndex = 5;
         this->textBox1->Text = "";
         this->findButton->Location = System::Drawing::Point( 248, 64 );
         this->findButton->Size = System::Drawing::Size( 40, 24 );
         this->findButton->TabIndex = 3;
         this->findButton->Text = "Find";
         this->findButton->Click += gcnew System::EventHandler( 
            this, &Win32Form1::findButton_Click );
         this->label1->Location = System::Drawing::Point( 8, 224 );
         this->label1->Size = System::Drawing::Size( 144, 23 );
         this->label1->TabIndex = 0;
         this->label1->Text = "Test ComboBox";
         this->ClientSize = System::Drawing::Size( 292, 273 );
         array<System::Windows::Forms::Control^>^ controlsArray = {this->comboBox1,
            this->textBox2,
            this->textBox1,
            this->showSelectedButton,
            this->findButton,
            this->addGrandButton,
            this->addButton,
            this->label1};
         this->Controls->AddRange( controlsArray );
         this->Text = "ComboBox Sample";
      }

      void addButton_Click( Object^ sender, System::EventArgs^ e )
      {
         comboBox1->Items->Add( textBox1->Text );
      }

      void addGrandButton_Click( Object^ sender, System::EventArgs^ e )
      {
         comboBox1->BeginUpdate();
         for ( int i = 0; i < 1000; i++ )
         {
            comboBox1->Items->Add( "Item 1 " + i.ToString() );

         }
         comboBox1->EndUpdate();
      }

      void findButton_Click( Object^ sender, System::EventArgs^ e )
      {
         int index = comboBox1->FindString( textBox2->Text );
         comboBox1->SelectedIndex = index;
      }

      void showSelectedButton_Click( Object^ sender, System::EventArgs^ e )
      {
         int selectedIndex = comboBox1->SelectedIndex;
         Object^ selectedItem = comboBox1->SelectedItem;
         MessageBox::Show( "Selected Item Text: " + selectedItem->ToString() + "\n" +
            "Index: " + selectedIndex.ToString() );
      }
   };
}


[System::STAThreadAttribute]
int main()
{
   System::Windows::Forms::Application::Run( gcnew Win32Form1Namespace::Win32Form1 );
}
using System;
using System.Windows.Forms;

namespace Win32Form1Namespace {
    
    
    public class Win32Form1 : System.Windows.Forms.Form {
        private System.Windows.Forms.Button addButton;
        private System.Windows.Forms.TextBox textBox2;
        private System.Windows.Forms.Button addGrandButton;
        private System.Windows.Forms.ComboBox comboBox1;
        private System.Windows.Forms.Button showSelectedButton;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Button findButton;
        private System.Windows.Forms.Label label1;
        
        public Win32Form1() {
            this.InitializeComponent();
        }
        
        [System.STAThreadAttribute()]
        public static void Main() {
            System.Windows.Forms.Application.Run(new Win32Form1());
        }
        
        private void InitializeComponent() {
            this.addButton = new System.Windows.Forms.Button();
            this.textBox2 = new System.Windows.Forms.TextBox();
            this.addGrandButton = new System.Windows.Forms.Button();
            this.comboBox1 = new System.Windows.Forms.ComboBox();
            this.showSelectedButton = new System.Windows.Forms.Button();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.findButton = new System.Windows.Forms.Button();
            this.label1 = new System.Windows.Forms.Label();
            this.addButton.Location = new System.Drawing.Point(248, 32);
            this.addButton.Size = new System.Drawing.Size(40, 24);
            this.addButton.TabIndex = 1;
            this.addButton.Text = "Add";
            this.addButton.Click += new System.EventHandler(this.addButton_Click);
            this.textBox2.Location = new System.Drawing.Point(8, 64);
            this.textBox2.Size = new System.Drawing.Size(232, 20);
            this.textBox2.TabIndex = 6;
            this.textBox2.Text = "";
            this.addGrandButton.Location = new System.Drawing.Point(8, 96);
            this.addGrandButton.Size = new System.Drawing.Size(280, 23);
            this.addGrandButton.TabIndex = 2;
            this.addGrandButton.Text = "Add 1,000 Items";
            this.addGrandButton.Click += new System.EventHandler(this.addGrandButton_Click);
            this.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) 
                        | System.Windows.Forms.AnchorStyles.Right);
            this.comboBox1.DropDownWidth = 280;
            this.comboBox1.Items.AddRange(new object[] {"Item 1",
                        "Item 2",
                        "Item 3",
                        "Item 4",
                        "Item 5"});
            this.comboBox1.Location = new System.Drawing.Point(8, 248);
            this.comboBox1.Size = new System.Drawing.Size(280, 21);
            this.comboBox1.TabIndex = 7;
            this.showSelectedButton.Location = new System.Drawing.Point(8, 128);
            this.showSelectedButton.Size = new System.Drawing.Size(280, 24);
            this.showSelectedButton.TabIndex = 4;
            this.showSelectedButton.Text = "What Item is Selected?";
            this.showSelectedButton.Click += new System.EventHandler(this.showSelectedButton_Click);
            this.textBox1.Location = new System.Drawing.Point(8, 32);
            this.textBox1.Size = new System.Drawing.Size(232, 20);
            this.textBox1.TabIndex = 5;
            this.textBox1.Text = "";
            this.findButton.Location = new System.Drawing.Point(248, 64);
            this.findButton.Size = new System.Drawing.Size(40, 24);
            this.findButton.TabIndex = 3;
            this.findButton.Text = "Find";
            this.findButton.Click += new System.EventHandler(this.findButton_Click);
            this.label1.Location = new System.Drawing.Point(8, 224);
            this.label1.Size = new System.Drawing.Size(144, 23);
            this.label1.TabIndex = 0;
            this.label1.Text = "Test ComboBox";
            this.ClientSize = new System.Drawing.Size(292, 273);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {this.comboBox1,
                        this.textBox2,
                        this.textBox1,
                        this.showSelectedButton,
                        this.findButton,
                        this.addGrandButton,
                        this.addButton,
                        this.label1});
            this.Text = "ComboBox Sample";
        }
        
        private void addButton_Click(object sender, System.EventArgs e) {
           comboBox1.Items.Add(textBox1.Text);
        }

        private void addGrandButton_Click(object sender, System.EventArgs e) {
            comboBox1.BeginUpdate();
            for (int i = 0; i < 1000; i++) {
                comboBox1.Items.Add("Item 1" + i.ToString());
            }
            comboBox1.EndUpdate();
        }

        private void findButton_Click(object sender, System.EventArgs e) {
            int index = comboBox1.FindString(textBox2.Text);
            comboBox1.SelectedIndex = index;
        }

        private void showSelectedButton_Click(object sender, System.EventArgs e) {
            int selectedIndex = comboBox1.SelectedIndex;
            Object selectedItem = comboBox1.SelectedItem;

            MessageBox.Show("Selected Item Text: " + selectedItem.ToString() + "\n" +
                            "Index: " + selectedIndex.ToString());
        }
    }
}
Imports System
Imports System.Windows.Forms

Namespace ComboBoxSampleNamespace

    Public Class ComboBoxSample
        Inherits System.Windows.Forms.Form

        Private addButton As System.Windows.Forms.Button
        Private textBox2 As System.Windows.Forms.TextBox
        Private addGrandButton As System.Windows.Forms.Button
        Private comboBox1 As System.Windows.Forms.ComboBox
        Private showSelectedButton As System.Windows.Forms.Button
        Private textBox1 As System.Windows.Forms.TextBox
        Private findButton As System.Windows.Forms.Button
        Private label1 As System.Windows.Forms.Label

        Public Sub New()
            MyBase.New()
            Me.InitializeComponent()
        End Sub

        <System.STAThreadAttribute()> Public Shared Sub Main()
            System.Windows.Forms.Application.Run(New ComboBoxSample())
        End Sub

        Private Sub InitializeComponent()
            Me.addButton = New System.Windows.Forms.Button()
            Me.textBox2 = New System.Windows.Forms.TextBox()
            Me.addGrandButton = New System.Windows.Forms.Button()
            Me.comboBox1 = New System.Windows.Forms.ComboBox()
            Me.showSelectedButton = New System.Windows.Forms.Button()
            Me.textBox1 = New System.Windows.Forms.TextBox()
            Me.findButton = New System.Windows.Forms.Button()
            Me.label1 = New System.Windows.Forms.Label()
            Me.addButton.Location = New System.Drawing.Point(248, 32)
            Me.addButton.Size = New System.Drawing.Size(40, 24)
            Me.addButton.TabIndex = 1
            Me.addButton.Text = "Add"
            AddHandler Me.addButton.Click, AddressOf Me.addButton_Click
            Me.textBox2.Location = New System.Drawing.Point(8, 64)
            Me.textBox2.Size = New System.Drawing.Size(232, 20)
            Me.textBox2.TabIndex = 6
            Me.textBox2.Text = ""
            Me.addGrandButton.Location = New System.Drawing.Point(8, 96)
            Me.addGrandButton.Size = New System.Drawing.Size(280, 23)
            Me.addGrandButton.TabIndex = 2
            Me.addGrandButton.Text = "Add 1,000 Items"
            AddHandler Me.addGrandButton.Click, AddressOf Me.addGrandButton_Click
            Me.comboBox1.Anchor = ((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
                        Or System.Windows.Forms.AnchorStyles.Right)
            Me.comboBox1.DropDownWidth = 280
            Me.comboBox1.Items.AddRange(New Object() {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"})
            Me.comboBox1.Location = New System.Drawing.Point(8, 248)
            Me.comboBox1.Size = New System.Drawing.Size(280, 21)
            Me.comboBox1.TabIndex = 7
            Me.showSelectedButton.Location = New System.Drawing.Point(8, 128)
            Me.showSelectedButton.Size = New System.Drawing.Size(280, 24)
            Me.showSelectedButton.TabIndex = 4
            Me.showSelectedButton.Text = "What Item is Selected?"
            AddHandler Me.showSelectedButton.Click, AddressOf Me.showSelectedButton_Click
            Me.textBox1.Location = New System.Drawing.Point(8, 32)
            Me.textBox1.Size = New System.Drawing.Size(232, 20)
            Me.textBox1.TabIndex = 5
            Me.textBox1.Text = ""
            Me.findButton.Location = New System.Drawing.Point(248, 64)
            Me.findButton.Size = New System.Drawing.Size(40, 24)
            Me.findButton.TabIndex = 3
            Me.findButton.Text = "Find"
            AddHandler Me.findButton.Click, AddressOf Me.findButton_Click
            Me.label1.Location = New System.Drawing.Point(8, 224)
            Me.label1.Size = New System.Drawing.Size(144, 23)
            Me.label1.TabIndex = 0
            Me.label1.Text = "Test ComboBox"
            Me.ClientSize = New System.Drawing.Size(292, 273)
            Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.comboBox1, Me.textBox2, Me.textBox1, Me.showSelectedButton, Me.findButton, Me.addGrandButton, Me.addButton, Me.label1})
            Me.Text = "ComboBox Sample"
        End Sub

        Private Sub addButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            comboBox1.Items.Add(textBox1.Text)
        End Sub

        Private Sub findButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim index As Integer
            index = comboBox1.FindString(textBox2.Text)
            comboBox1.SelectedIndex = index
        End Sub

        Private Sub addGrandButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            comboBox1.BeginUpdate()
            Dim I As Integer
            For I = 0 To 1000
                comboBox1.Items.Add("Item 1" + i.ToString())
            Next
            comboBox1.EndUpdate()
        End Sub

        Private Sub showSelectedButton_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim selectedIndex As Integer
            selectedIndex = comboBox1.SelectedIndex
            Dim selectedItem As Object
            selectedItem = comboBox1.SelectedItem

            MessageBox.Show("Selected Item Text: " & selectedItem.ToString() & Microsoft.VisualBasic.Constants.vbCrLf & _
                                "Index: " & selectedIndex.ToString())
        End Sub
    End Class
End Namespace

Remarks

A ComboBox displays a text box combined with a ListBox, which enables the user to select items from the list or enter a new value.

The DropDownStyle property specifies whether the list is always displayed or whether the list is displayed in a drop-down. The DropDownStyle property also specifies whether the text portion can be edited. See ComboBoxStyle for the available settings and their effects. There is no setting to always display the list and disallow entering a new value. To display a list to which no new values can be added, use a ListBox control.

To add or remove objects in the list at run time, use methods of the ComboBox.ObjectCollection class (through the Items property of the ComboBox). You can assign an array of object references with the AddRange method. The list then displays the default string value for each object. You can add individual objects with the Add method. You can delete items with the Remove method or clear the entire list with the Clear method.

In addition to display and selection functionality, the ComboBox also provides features that enable you to efficiently add items to the ComboBox and to find text within the items of the list. With the BeginUpdate and EndUpdate methods, you can add a large number of items to the ComboBox 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.

You can use these properties to manage the currently selected item in the list, the Text property to specify the string displayed in the editing field, the SelectedIndex property to get or set the current item, and the SelectedItem property to get or set a reference to the object.

Note

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

Constructors

ComboBox()

Initializes a new instance of the ComboBox class.

Properties

AutoCompleteCustomSource

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

AutoCompleteMode

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

AutoCompleteSource

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

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 as defined in the ImageLayout enumeration.

CreateParams

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

DataSource

Gets or sets the data source for this ComboBox.

DefaultSize

Gets the default size of the control.

DrawMode

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

DropDownHeight

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

DropDownStyle

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

DropDownWidth

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

DroppedDown

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

FlatStyle

Gets or sets the appearance of the ComboBox.

Focused

Gets a value indicating whether the ComboBox has focus.

ForeColor

Gets or sets the foreground color of 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 combo box.

Items

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

MaxDropDownItems

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

MaximumSize

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

MaxLength

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

MinimumSize

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

Padding

This property is not relevant for this class.

PreferredHeight

Gets the preferred height of the ComboBox.

SelectedIndex

Gets or sets the index specifying the currently selected item.

SelectedItem

Gets or sets currently selected item in the ComboBox.

SelectedText

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

SelectionLength

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

SelectionStart

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

Sorted

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

Text

Gets or sets the text associated with this control.

Methods

AddItemsCore(Object[])

Adds the specified items to the combo box.

BeginUpdate()

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

CreateAccessibilityInstance()

Creates a new accessibility object for the control.

CreateHandle()

Creates a handle for the control.

Dispose(Boolean)

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

EndUpdate()

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

FindString(String)

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

FindString(String, Int32)

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

FindStringExact(String)

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

FindStringExact(String, Int32)

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

GetItemHeight(Int32)

Returns the height of an item in the ComboBox.

IsInputKey(Keys)

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

OnBackColorChanged(EventArgs)

Raises the BackColorChanged event.

OnDataSourceChanged(EventArgs)

Raises the DataSourceChanged event.

OnDisplayMemberChanged(EventArgs)

Raises the DisplayMemberChanged event.

OnDrawItem(DrawItemEventArgs)

Raises the DrawItem event.

OnDropDown(EventArgs)

Raises the DropDown event.

OnDropDownClosed(EventArgs)

Raises the DropDownClosed event.

OnDropDownStyleChanged(EventArgs)

Raises the DropDownStyleChanged event.

OnFontChanged(EventArgs)

Raises the FontChanged event.

OnForeColorChanged(EventArgs)

Raises the ForeColorChanged event.

OnGotFocus(EventArgs)

Raises the GotFocus event.

OnHandleCreated(EventArgs)

Raises the HandleCreated event.

OnHandleDestroyed(EventArgs)

Raises the HandleDestroyed event.

OnKeyDown(KeyEventArgs)

Raises the KeyDown event.

OnKeyPress(KeyPressEventArgs)

Raises the KeyPress event.

OnLostFocus(EventArgs)

Raises the LostFocus event.

OnMeasureItem(MeasureItemEventArgs)

Raises the MeasureItem event.

OnMouseEnter(EventArgs)

Raises the MouseEnter event.

OnMouseLeave(EventArgs)

Raises the MouseLeave event.

OnParentBackColorChanged(EventArgs)

Raises the BackColorChanged event.

OnResize(EventArgs)

Raises the Resize event.

OnSelectedIndexChanged(EventArgs)

Raises the SelectedIndexChanged event.

OnSelectedItemChanged(EventArgs)

Raises the SelectedItemChanged event.

OnSelectedValueChanged(EventArgs)

Raises the SelectedValueChanged event.

OnSelectionChangeCommitted(EventArgs)

Raises the SelectionChangeCommitted event.

OnTextChanged(EventArgs)

Raises the TextChanged event.

OnTextUpdate(EventArgs)

Raises the TextUpdate event.

OnValidating(CancelEventArgs)

Raises the Validating event.

ProcessKeyEventArgs(Message)

Processes a key message and generates the appropriate control events.

RefreshItem(Int32)

Refreshes the item contained at the specified location.

RefreshItems()

Refreshes all ComboBox items.

ResetText()

Resets the Text property to its default value.

ScaleControl(SizeF, BoundsSpecified)

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

Select(Int32, Int32)

Selects a range of text in the editable portion of the ComboBox.

SelectAll()

Selects all the text in the editable portion of the ComboBox.

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

Sets the size and location of the ComboBox.

SetItemCore(Int32, Object)

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

SetItemsCore(IList)

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

ToString()

Returns a string that represents the ComboBox control.

WndProc(Message)

Processes Windows messages.

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
Click 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
CreateControl() Inherited from Control
CreateControlsInstance() Inherited from Control
Created Inherited from Control
CreateGraphics() 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
Disposing Inherited from Control
Dock Inherited from Control
DockChanged Inherited from Control
DoDragDrop(Object, DragDropEffects) Inherited from Control
DoubleBuffered 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
Font 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
GetScaledBounds(Rectangle, SizeF, BoundsSpecified) 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
ModifierKeys Inherited from Control
MouseButtons Inherited from Control
MouseCaptureChanged Inherited from Control
MouseClick 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
OnBackgroundImageChanged(EventArgs) Inherited from Control
OnBackgroundImageLayoutChanged(EventArgs) Inherited from Control
OnCausesValidationChanged(EventArgs) Inherited from Control
OnChangeUICues(UICuesEventArgs) 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
OnGiveFeedback(GiveFeedbackEventArgs) Inherited from Control
OnHelpRequested(HelpEventArgs) Inherited from Control
OnImeModeChanged(EventArgs) Inherited from Control
OnInvalidated(InvalidateEventArgs) Inherited from Control
OnKeyUp(KeyEventArgs) Inherited from Control
OnLayout(LayoutEventArgs) Inherited from Control
OnLeave(EventArgs) Inherited from Control
OnLocationChanged(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
OnMouseHover(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
OnParentBackgroundImageChanged(EventArgs) Inherited from Control
OnParentBindingContextChanged(EventArgs) Inherited from Control
OnParentChanged(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
OnValidated(EventArgs) 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
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
Refresh() Inherited from Control
Region Inherited from Control
RegionChanged Inherited from Control
RenderRightToLeft Inherited from Control
RescaleConstantsForDpi(Int32, Int32) Inherited from Control
ResetBackColor() Inherited from Control
ResetBindings() Inherited from Control
ResetCursor() Inherited from Control
ResetFont() Inherited from Control
ResetForeColor() Inherited from Control
ResetImeMode() Inherited from Control
ResetMouseEventArgs() Inherited from Control
ResetRightToLeft() Inherited from Control
Resize Inherited from Control
ResizeRedraw Inherited from Control
ResumeLayout() Inherited from Control
ResumeLayout(Boolean) Inherited from Control
Right Inherited from Control
RightToLeft 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
TextChanged 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
AllowSelection Inherited from ListControl
DataManager 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
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 value of the BackgroundImage property changes.

BackgroundImageLayoutChanged

Occurs when the BackgroundImageLayout property changes.

DoubleClick

This event is not relevant for this class.

DrawItem

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

DropDown

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

DropDownClosed

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

DropDownStyleChanged

Occurs when the DropDownStyle property has changed.

MeasureItem

Occurs each time an owner-drawn 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 ComboBox control is redrawn.

SelectedIndexChanged

Occurs when the SelectedIndex property has changed.

SelectionChangeCommitted

Occurs when the user changes the selected item and that change is displayed in the ComboBox.

TextUpdate

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

Applies to