WebControl.BackColor Özellik
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Web sunucusu denetiminin arka plan rengini alır veya ayarlar.
public:
virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
[System.ComponentModel.Bindable(true)]
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual System.Drawing.Color BackColor { get; set; }
[System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))]
public virtual System.Drawing.Color BackColor { get; set; }
[<System.ComponentModel.Bindable(true)>]
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))>]
member this.BackColor : System.Drawing.Color with get, set
[<System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.WebColorConverter))>]
member this.BackColor : System.Drawing.Color with get, set
Public Overridable Property BackColor As Color
Özellik Değeri
Color Denetimin arka plan rengini temsil eden bir. Varsayılan değer, Emptybu özelliğin ayarlanmadığını gösteren değeridir.
- Öznitelikler
Örnekler
Aşağıdaki örnekte, temel sınıftan BackColor devralınan Table denetimin özelliğinin nasıl ayarlanacağı WebControl gösterilmektedir.
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>BackColor Property</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>BackColor Property of a Web Control</h3>
<asp:Table id="Table1" runat="server"
CellPadding = "10"
GridLines="Both"
BackColor="LightBlue">
<asp:TableRow>
<asp:TableCell>
Row 0, Col 0
</asp:TableCell>
<asp:TableCell>
Row 0, Col 1
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
Row 1, Col 0
</asp:TableCell>
<asp:TableCell>
Row 1, Col 1
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>
<%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>BackColor Property</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h3>BackColor Property of a Web Control</h3>
<asp:Table id="Table1" runat="server"
CellPadding = "10"
GridLines="Both"
BackColor="LightBlue">
<asp:TableRow>
<asp:TableCell>
Row 0, Col 0
</asp:TableCell>
<asp:TableCell>
Row 0, Col 1
</asp:TableCell>
</asp:TableRow>
<asp:TableRow>
<asp:TableCell>
Row 1, Col 0
</asp:TableCell>
<asp:TableCell>
Row 1, Col 1
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</div>
</form>
</body>
</html>
Açıklamalar
Web sunucusu denetiminin BackColor arka plan rengini belirtmek için özelliğini kullanın. Bu özellik bir System.Drawing.Color nesne kullanılarak ayarlanır.
Uyarı
Bu özellik yalnızca belirli denetimler için işlenir. Örneğin, Table, Panel, DataGrid, Calendarve ValidationSummary bu özelliği işler. Ayrıca için CheckBoxListRadioButtonList de çalışır ve DataList özelliği RepeatLayoutRepeatLayout.Tableise , değilRepeatLayout.Flow.
Genel olarak, yalnızca etiket olarak <table> işlenen denetimler HTML 3.2'de arka plan rengi görüntüleyebilirken, neredeyse tüm denetimler HTML 4.0'da görüntülenebilir.
Etiket olarak <span> işlenen denetimler için (tüm Labeldoğrulama denetimleri ve özelliği ayarlanmış RepeatLayout.Flowliste denetimleri RepeatLayout dahil), bu özellik Microsoft Internet Explorer sürüm 5 ve sonraki sürümlerde çalışır, ancak Microsoft Internet Explorer sürüm 4'te çalışmaz.