ComboBoxStyle ComboBoxStyle ComboBoxStyle ComboBoxStyle Enum

정의

ComboBox 스타일을 지정합니다.Specifies the ComboBox style.

public enum class ComboBoxStyle
public enum ComboBoxStyle
type ComboBoxStyle = 
Public Enum ComboBoxStyle
상속
ComboBoxStyleComboBoxStyleComboBoxStyleComboBoxStyle

필드

DropDown DropDown DropDown DropDown 1

아래쪽 화살표를 클릭하면 목록이 표시되고 텍스트 부분을 편집할 수 있도록 지정합니다.Specifies that the list is displayed by clicking the down arrow and that the text portion is editable. 즉, 사용자가 목록에서 기존 값을 입력할 수 있을 뿐만 아니라 새 값을 입력할 수 있습니다.This means that the user can enter a new value and is not limited to selecting an existing value in the list. 이 설정을 사용하면 AppendAutoCompleteMode 값이 SuggestAppend 값과 동일한 방식으로 작동합니다.When using this setting, the Append value of AutoCompleteMode works the same as the SuggestAppend value. 기본 스타일입니다.This is the default style.

DropDownList DropDownList DropDownList DropDownList 2

아래쪽 화살표를 클릭하면 목록이 표시되고 텍스트 부분을 편집할 수 없도록 지정합니다.Specifies that the list is displayed by clicking the down arrow and that the text portion is not editable. 즉, 사용자가 새 값을 입력할 수 없습니다.This means that the user cannot enter a new value. 목록의 기존 값만 선택할 수 있습니다.Only values already in the list can be selected. 목록은 AutoCompleteModeSuggest 또는 SuggestAppend일 경우에만 표시됩니다.The list displays only if AutoCompleteMode is Suggest or SuggestAppend.

Simple Simple Simple Simple 0

목록이 항상 표시되고 텍스트 부분을 편집할 수 있도록 지정합니다.Specifies that the list is always visible and that the text portion is editable. 즉, 사용자가 목록에서 기존 값을 입력할 수 있을 뿐만 아니라 새 값을 입력할 수 있습니다.This means that the user can enter a new value and is not limited to selecting an existing value in the list.

예제

다음 코드 예제에는 초기화 하는 방법을 보여 줍니다.는 ComboBox 설정 하 여 컨트롤을 ComboBox.DropDownStyle 속성을를 ComboBoxStyle 값입니다.The following code example demonstrates how to initialize a ComboBox control by setting the ComboBox.DropDownStyle property to a ComboBoxStyle value.

   // 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->IntegralHeight = false;
      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.
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.IntegralHeight = false;
       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.
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.IntegralHeight = False
    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


설명

DropDownStyle 속성은 항상 표시 되는지 여부 또는 목록 드롭다운에 표시 되는지 여부를 지정 합니다.The DropDownStyle property specifies whether the list is always displayed or whether the list is displayed in a drop-down. DropDownStyle 속성 텍스트 부분을 편집할 수 있는지 여부를 지정 합니다.The DropDownStyle property also specifies whether the text portion can be edited.

적용 대상