ColorDialog.CustomColors 속성

정의

대화 상자에 표시된 사용자 지정 색 집합을 가져오거나 설정합니다.

public:
 property cli::array <int> ^ CustomColors { cli::array <int> ^ get(); void set(cli::array <int> ^ value); };
[System.ComponentModel.Browsable(false)]
public int[] CustomColors { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.CustomColors : int[] with get, set
Public Property CustomColors As Integer()

속성 값

Int32[]

대화 상자에 표시된 사용자 지정 색 집합입니다. 기본값은 null입니다.

특성

예제

다음 코드 예제에는 형식의 배열을 추가 하는 방법을 보여 줍니다 Int32 사용자 지정 색을 나타내는 CustomColors합니다. 이 예제에서는 코드 내에서 실행 되는 Form합니다.

System::Windows::Forms::ColorDialog^ MyDialog = gcnew ColorDialog;

// Allows the user to select or edit a custom color.
MyDialog->AllowFullOpen = true;

// Assigns an array of custom colors to the CustomColors property
array<int>^temp0 = {6916092,15195440,16107657,1836924,3758726,12566463,7526079,7405793,6945974,241502,2296476,5130294,3102017,7324121,14993507,11730944};
MyDialog->CustomColors = temp0;

// Allows the user to get help. (The default is false.)
MyDialog->ShowHelp = true;

// Sets the initial color select to the current text color,
// so that if the user cancels out, the original color is restored.
MyDialog->Color = this->BackColor;
MyDialog->ShowDialog();
this->BackColor = MyDialog->Color;
System.Windows.Forms.ColorDialog MyDialog = new ColorDialog();
// Allows the user to select or edit a custom color.
MyDialog.AllowFullOpen = true ;
// Assigns an array of custom colors to the CustomColors property
MyDialog.CustomColors = new int[]{6916092, 15195440, 16107657, 1836924,
   3758726, 12566463, 7526079, 7405793, 6945974, 241502, 2296476, 5130294,
   3102017, 7324121, 14993507, 11730944,};

// Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = true ;
// Sets the initial color select to the current text color,
// so that if the user cancels out, the original color is restored.
MyDialog.Color = this.BackColor;
MyDialog.ShowDialog();
this.BackColor =  MyDialog.Color;
Dim MyDialog = New ColorDialog()
' Allows the user to select or edit a custom color.
MyDialog.AllowFullOpen = True
' Assigns an array of custom colors to the CustomColors property.
MyDialog.CustomColors = New Integer() {6916092, 15195440, 16107657, 1836924, _
   3758726, 12566463, 7526079, 7405793, 6945974, 241502, 2296476, 5130294, _
   3102017, 7324121, 14993507, 11730944}

' Allows the user to get help. (The default is false.)
MyDialog.ShowHelp = True
' Sets the initial color select to the current text color,
' so that if the user cancels out, the original color is restored.
MyDialog.Color = Me.BackColor
MyDialog.ShowDialog()
Me.BackColor = MyDialog.Color

설명

사용자가 자신의 사용자 지정 색 집합을 만들 수 있습니다. 이러한 색에 포함 된는 Int32 색을 만드는 데 필요한 BGR (파랑, 녹색, 빨간색) 값으로 구성 합니다. 이 데이터의 구조에 대 한 자세한 내용은 참조 하세요. Color합니다.

사용자 지정 색만 정의 될 수 있으면 AllowFullOpen 로 설정 된 true합니다.

적용 대상

추가 정보