ColorDialog.CustomColors プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ColorDialog.CustomColors プロパティの意味・解説 

ColorDialog.CustomColors プロパティ

ダイアログ ボックス表示されるカスタム カラー セット取得または設定します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Dim instance As ColorDialog
Dim value As Integer()

value = instance.CustomColors

instance.CustomColors = value
public int[] CustomColors { get;
 set; }
public:
property array<int>^ CustomColors {
    array<int>^ get ();
    void set (array<int>^
 value);
}
/** @property */
public int[] get_CustomColors ()

/** @property */
public void set_CustomColors (int[]
 value)
public function get CustomColors
 () : int[]

public function set CustomColors
 (value : int[])

プロパティ
ダイアログ ボックス表示されるカスタム カラー セット既定値null 参照 (Visual Basic では Nothing) です。

解説解説

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

カスタム カラーは、AllowFullOpen が true設定されている場合にだけ定義できます

使用例使用例

カスタム カラーを表す 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());
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からColorDialog.CustomColors プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からColorDialog.CustomColors プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からColorDialog.CustomColors プロパティを検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ColorDialog.CustomColors プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ColorDialog.CustomColors プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS