ComboBoxStyle 列挙体
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Public Enumeration ComboBoxStyle

メンバ名 | 説明 | |
---|---|---|
![]() | DropDown | テキスト部分は編集できます。リスト部分を表示するには、矢印ボタンをクリックします。これは、既定のスタイルです。 |
![]() | DropDownList | ユーザーはテキスト部分を直接編集できません。リスト部分を表示するには、矢印ボタンをクリックします。リストが表示されるのは、AutoCompleteMode が Suggest または SuggestAppend の場合に限られます。 |
Simple | テキスト部分は編集できます。リスト部分は常に表示されます。 |

DropDownStyle プロパティでは、ユーザーがテキスト部分に新しい値を入力できるかどうか、リスト部分が常に表示されているかどうかが決定されます。
Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows CE プラットフォームメモ : 既定のスタイルは DropDownList です。

ComboBox.DropDownStyle プロパティを ComboBoxStyle 値に設定して、ComboBox コントロールを初期化する方法を次のコード例に示します。
' Declare comboBox1 as a ComboBox. Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox ' This method initializes the combo box, adding a large string ' array but limiting the drop-down size to six rows so the combo box ' doesn't cover other controls when it expands. Private Sub InitializeComboBox() Me.ComboBox1 = New System.Windows.Forms.ComboBox Dim employees() As String = New String() {"Hamilton, David", _ "Hensien, Kari", "Hammond, Maria", "Harris, Keith", _ "Henshaw, Jeff D.", "Hanson, Mark", "Harnpadoungsataya, Sariya", _ "Harrington, Mark", "Harris, Keith", "Hartwig, Doris", _ "Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas", _ "Harnpadoungsataya, Sariya", "Henshaw, Jeff D.", "Henshaw, Jeff D.", _ "Hensien, Kari", "Harris, Keith", "Henshaw, Jeff D.", _ "Hensien, Kari", "Hasselberg, Jonas", "Harrington, Mark", _ "Hedlund, Magnus", "Hay, Jeff", "Heidepriem, Brandon D."} ComboBox1.Items.AddRange(employees) Me.ComboBox1.Location = New System.Drawing.Point(136, 32) Me.ComboBox1.MaxDropDownItems = 5 Me.ComboBox1.DropDownStyle = ComboBoxStyle.DropDown Me.ComboBox1.Name = "ComboBox1" Me.ComboBox1.Size = New System.Drawing.Size(136, 81) Me.ComboBox1.TabIndex = 0 Me.Controls.Add(Me.ComboBox1) End Sub
// Declare comboBox1 as a ComboBox. internal System.Windows.Forms.ComboBox ComboBox1; // This method initializes the combo box, adding a large string array // but limiting the drop-down size to six rows so the combo box doesn't // cover other controls when it expands. private void InitializeComboBox() { this.ComboBox1 = new System.Windows.Forms.ComboBox(); string[] employees = new string[]{"Hamilton, David", "Hensien, Kari", "Hammond, Maria", "Harris, Keith", "Henshaw, Jeff D.", "Hanson, Mark", "Harnpadoungsataya, Sariya", "Harrington, Mark", "Harris, Keith", "Hartwig, Doris", "Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas", "Harnpadoungsataya, Sariya", "Henshaw, Jeff D.", "Henshaw, Jeff D.", "Hensien, Kari", "Harris, Keith", "Henshaw, Jeff D.", "Hensien, Kari", "Hasselberg, Jonas", "Harrington, Mark", "Hedlund, Magnus", "Hay, Jeff", "Heidepriem, Brandon D."}; ComboBox1.Items.AddRange(employees); this.ComboBox1.Location = new System.Drawing.Point(136, 32); this.ComboBox1.MaxDropDownItems = 5; this.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList; this.ComboBox1.Name = "ComboBox1"; this.ComboBox1.Size = new System.Drawing.Size(136, 81); this.ComboBox1.TabIndex = 0; this.Controls.Add(this.ComboBox1); // Associate the event-handling method with the // SelectedIndexChanged event. this.ComboBox1.SelectedIndexChanged += new System.EventHandler(ComboBox1_SelectedIndexChanged); }
// Declare comboBox1 as a ComboBox. internal: System::Windows::Forms::ComboBox^ ComboBox1; private: // This method initializes the combo box, adding a large string array // but limiting the drop-down size to six rows so the combo box doesn't // cover other controls when it expands. void InitializeComboBox() { this->ComboBox1 = gcnew System::Windows::Forms::ComboBox; array<String^>^ employees = {"Hamilton, David","Hensien, Kari", "Hammond, Maria","Harris, Keith","Henshaw, Jeff D.", "Hanson, Mark","Harnpadoungsataya, Sariya", "Harrington, Mark","Harris, Keith","Hartwig, Doris" , "Harui, Roger","Hassall, Mark","Hasselberg, Jonas" , "Harnpadoungsataya, Sariya","Henshaw, Jeff D.", "Henshaw, Jeff D.","Hensien, Kari","Harris, Keith" , "Henshaw, Jeff D.","Hensien, Kari","Hasselberg, Jonas", "Harrington, Mark","Hedlund, Magnus","Hay, Jeff" , "Heidepriem, Brandon D."}; ComboBox1->Items->AddRange( employees ); this->ComboBox1->Location = System::Drawing::Point( 136, 32 ); this->ComboBox1->MaxDropDownItems = 5; this->ComboBox1->DropDownStyle = ComboBoxStyle::DropDownList; this->ComboBox1->Name = "ComboBox1"; this->ComboBox1->Size = System::Drawing::Size( 136, 81 ); this->ComboBox1->TabIndex = 0; this->Controls->Add( this->ComboBox1 ); // Associate the event-handling method with the // SelectedIndexChanged event. this->ComboBox1->SelectedIndexChanged += gcnew System::EventHandler( this, &Form1::ComboBox1_SelectedIndexChanged ); }
// Declare comboBox1 as a ComboBox. System.Windows.Forms.ComboBox comboBox1; // This method initializes the combo box, adding a large string array // but limiting the drop-down size to six rows so the combo box doesn't // cover other controls when it expands. private void InitializeComboBox() { this.comboBox1 = new System.Windows.Forms.ComboBox(); String employees[] = new String[] { "Hamilton, David", "Hensien, Kari", "Hammond, Maria", "Harris, Keith", "Henshaw, Jeff D.", "Hanson, Mark", "Harnpadoungsataya, Sariya", "Harrington, Mark", "Harris, Keith", "Hartwig, Doris", "Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas", "Harnpadoungsataya, Sariya", "Henshaw, Jeff D.","Henshaw, Jeff D.", "Hensien, Kari", "Harris, Keith", "Henshaw, Jeff D.", "Hensien, Kari", "Hasselberg, Jonas", "Harrington, Mark", "Hedlund, Magnus", "Hay, Jeff", "Heidepriem, Brandon D." }; comboBox1.get_Items().AddRange(employees); this.comboBox1.set_Location(new System.Drawing.Point(136, 32)); this.comboBox1.set_MaxDropDownItems(5); this.comboBox1.set_DropDownStyle(ComboBoxStyle.DropDownList); this.comboBox1.set_Name("comboBox1"); this.comboBox1.set_Size(new System.Drawing.Size(136, 81)); this.comboBox1.set_TabIndex(0); this.get_Controls().Add(this.comboBox1); // Associate the event-handling method with the // SelectedIndexChanged event. this.comboBox1.add_SelectedIndexChanged(new System.EventHandler( comboBox1_SelectedIndexChanged)); } //InitializeComboBox

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からComboBoxStyle 列挙体を検索する場合は、下記のリンクをクリックしてください。

- ComboBoxStyle 列挙体のページへのリンク