ColorDialog.AllowFullOpen 속성

정의

대화 상자를 사용하여 사용자 지정 색을 정의할 수 있는지를 나타내는 값을 가져오거나 설정합니다.

public:
 virtual property bool AllowFullOpen { bool get(); void set(bool value); };
public virtual bool AllowFullOpen { get; set; }
member this.AllowFullOpen : bool with get, set
Public Overridable Property AllowFullOpen As Boolean

속성 값

Boolean

사용자 지정 색을 정의할 수 있으면 true이고, 그렇지 않으면 false입니다. 기본값은 true입니다.

예제

다음 예제를 만드는 새 ColorDialog합니다. 이 예제에서는 메서드에 있는 기존 폼 내에서 호출 되는 한 TextBoxButton 배치 합니다.

private:
   void button1_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      ColorDialog^ MyDialog = gcnew ColorDialog;
      // Keeps the user from selecting a custom color.
      MyDialog->AllowFullOpen = false;
      // Allows the user to get help. (The default is false.)
      MyDialog->ShowHelp = true;
      // Sets the initial color select to the current text color.
      MyDialog->Color = textBox1->ForeColor;
      
      // Update the text box color if the user clicks OK 
      if ( MyDialog->ShowDialog() == ::System::Windows::Forms::DialogResult::OK )
      {
         textBox1->ForeColor = MyDialog->Color;
      }
   }
private void button1_Click(object sender, System.EventArgs e)
 {
    ColorDialog MyDialog = new ColorDialog();
    // Keeps the user from selecting a custom color.
    MyDialog.AllowFullOpen = false ;
    // Allows the user to get help. (The default is false.)
    MyDialog.ShowHelp = true ;
    // Sets the initial color select to the current text color.
    MyDialog.Color = textBox1.ForeColor ;
    
    // Update the text box color if the user clicks OK 
    if (MyDialog.ShowDialog() == DialogResult.OK)
        textBox1.ForeColor =  MyDialog.Color;
 }
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim MyDialog As New ColorDialog()
    ' Keeps the user from selecting a custom color.
    MyDialog.AllowFullOpen = False
    ' Allows the user to get help. (The default is false.)
    MyDialog.ShowHelp = True
    ' Sets the initial color select to the current text color,
    MyDialog.Color = TextBox1.ForeColor

    ' Update the text box color if the user clicks OK 
    If (MyDialog.ShowDialog() = Windows.Forms.DialogResult.OK) Then
        TextBox1.ForeColor = MyDialog.Color
    End If
End Sub

설명

로 설정 하면 false대화 상자에서 연결된 단추가 비활성화 되 고 사용자 대화 상자에서 사용자 지정 색 컨트롤에 액세스할 수 없습니다.

적용 대상

추가 정보