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



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

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

- Control.DefaultForeColor プロパティのページへのリンク