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

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

Control.DefaultForeColor プロパティ

コントロール既定前景色を取得します

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

Public Shared ReadOnly Property
 DefaultForeColor As Color
Dim value As Color

value = Control.DefaultForeColor
public static Color DefaultForeColor { get;
 }
public:
static property Color DefaultForeColor {
    Color get ();
}
/** @property */
public static Color get_DefaultForeColor ()
public static function get
 DefaultForeColor () : Color

プロパティ
コントロール既定前景Color既定値は SystemColors.ControlText です。

解説解説

これは、親のないコントロール既定の ForeColor プロパティ値です。派生クラス既定値異な場合あります

使用例使用例

DefaultBackColor メンバ、DefaultFont メンバ、および DefaultForeColor メンバ使用方法を示すコード例次に示します。この例を実行するには、ListBox1 という名前の ListBox配置されているフォームに、次のコード貼り付けます。フォームコンストラクタまたは Load イベント処理メソッドPopulate_ListBox メソッド呼び出します。

' The following method displays the default font, 
' background color and foreground color values for the ListBox  
' control. The values are displayed in the ListBox, itself.

Private Sub Populate_ListBox()
    ListBox1.Dock = DockStyle.Bottom

    ' Display the values in the read-only properties 
    ' DefaultBackColor, DefaultFont, DefaultForecolor.
    ListBox1.Items.Add("Default BackColor: " &
 ListBox.DefaultBackColor.ToString)
    ListBox1.Items.Add("Default Font: " & ListBox.DefaultFont.ToString)
    ListBox1.Items.Add("Default ForeColor:" &
 ListBox.DefaultForeColor.ToString)

End Sub
// The following method displays the default font, 
// background color and foreground color values for the ListBox  
// control. The values are displayed in the ListBox, itself.

private void Populate_ListBox()
{
    ListBox1.Dock = DockStyle.Bottom;

    // Display the values in the read-only properties 
    // DefaultBackColor, DefaultFont, DefaultForecolor.
    ListBox1.Items.Add("Default BackColor: " + 
        ListBox.DefaultBackColor.ToString());
    ListBox1.Items.Add("Default Font: " + 
        ListBox.DefaultFont.ToString());
    ListBox1.Items.Add("Default ForeColor:" + 
        ListBox.DefaultForeColor.ToString());

}
// The following method displays the default font, 
// background color and foreground color values for the ListBox  
// control. The values are displayed in the ListBox, itself.
void Populate_ListBox()
{
   ListBox1->Dock = DockStyle::Bottom;
   
   // Display the values in the read-only properties 
   // DefaultBackColor, DefaultFont, DefaultForecolor.
   ListBox1->Items->Add( String::Format( "Default BackColor: {0}",
 ListBox::DefaultBackColor ) );
   ListBox1->Items->Add( String::Format( "Default Font: {0}", ListBox::DefaultFont
 ) );
   ListBox1->Items->Add( String::Format( "Default ForeColor:{0}",
 ListBox::DefaultForeColor ) );
}
// The following method displays the default font, 
// background color and foreground color values for the ListBox  
// control. The values are displayed in the ListBox, itself.
private void Populate_ListBox()
{
    listBox1.set_Dock(DockStyle.Bottom);
    // Display the values in the read-only properties 
    // DefaultBackColor, DefaultFont, DefaultForecolor.
    listBox1.get_Items().Add("Default BackColor: " 
        + ListBox.get_DefaultBackColor().ToString());
    listBox1.get_Items().Add("Default Font: " 
        + ListBox.get_DefaultFont().ToString());
    listBox1.get_Items().Add("Default ForeColor:" 
        + ListBox.get_DefaultForeColor().ToString());
} //Populate_ListBox
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS