Control.DefaultBackColor 속성
정의
컨트롤의 기본 배경색을 가져오거나 설정합니다.Gets the default background color of the control.
public:
static property System::Drawing::Color DefaultBackColor { System::Drawing::Color get(); };
public static System.Drawing.Color DefaultBackColor { get; }
member this.DefaultBackColor : System.Drawing.Color
Public Shared ReadOnly Property DefaultBackColor As Color
속성 값
컨트롤의 기본 배경 Color입니다.The default background Color of the control. 기본값은 Control입니다.The default is Control.
예제
다음 코드 예제에서는 DefaultBackColor , 및 멤버를 사용 하는 방법을 보여 줍니다 DefaultFont DefaultForeColor .The following code example demonstrates how to use the DefaultBackColor, DefaultFont, and DefaultForeColor members. 예제를 실행 하려면 호출 된 ListBox1을 포함 하는 폼에 다음 코드를 붙여넣습니다 ListBox .To run the example, paste the following code in a form containing a ListBox called ListBox1. 호출 된 Populate_ListBox
폼의 생성자 또는 Load 이벤트 처리 메서드.Call the Populate_ListBox
method in the form's constructor or Load event-handling method.
// 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.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.
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
설명
BackColor일반 최상위 컨트롤의 기본 속성 값입니다.This is the default BackColor property value of a generic top-level control. 파생 클래스의 기본값은 다를 수 있습니다.Derived classes can have different defaults.