ColorDialog.CustomColors プロパティ
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)

Dim instance As ColorDialog Dim value As Integer() value = instance.CustomColors instance.CustomColors = value
/** @property */ public int[] get_CustomColors () /** @property */ public void set_CustomColors (int[] value)
ダイアログ ボックスに表示されるカスタム カラー セット。既定値は null 参照 (Visual Basic では Nothing) です。

ユーザーは独自のカスタム カラー セットを作成できます。これらの色は、色の作成に必要な ARGB コンポーネント (アルファ、赤、緑、および青) 値で構成される Int32 に格納されます。このデータの構造体の詳細については、Color のトピックを参照してください。

カスタム カラーを表す Int32 型の配列を CustomColors に追加する方法を次のコード例に示します。この例では、コードを Form 内から実行する必要があります。
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
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;
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.set_AllowFullOpen(true); // Assigns an array of custom colors to the CustomColors property myDialog.set_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.set_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.set_Color(this.get_BackColor()); myDialog.ShowDialog(); this.set_BackColor(myDialog.get_Color());

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に収録されているすべての辞書からColorDialog.CustomColors プロパティを検索する場合は、下記のリンクをクリックしてください。

- ColorDialog.CustomColors プロパティのページへのリンク