ColorDialog.CustomColors Özellik

Tanım

İletişim kutusunda gösterilen özel renk kümesini alır veya ayarlar.

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()

Özellik Değeri

Int32[]

İletişim kutusunda gösterilen özel renkler kümesi. null varsayılan değerdir.

Öznitelikler

Örnekler

Aşağıdaki kod örneğinde özel renkleri temsil eden bir tür Int32 dizisinin 'e nasıl ekleneceği gösterilmektedir CustomColors. Bu örnek, kodun içinden Formçalıştırılmasını gerektirir.

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

Açıklamalar

Kullanıcılar kendi özel renk kümelerini oluşturabilir. Bu renkler, rengi oluşturmak için gereken BGR (mavi, yeşil, kırmızı) değerlerinden oluşan bir Int32 değerde yer alır. Bu verilerin yapısı hakkında daha fazla bilgi için bkz Color. .

Özel renkler yalnızca olarak ayarlandığında truetanımlanabilirAllowFullOpen.

Şunlara uygulanır

Ayrıca bkz.