WebPartZoneBase.BorderColor Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur warna untuk batas WebPartZoneBase kontrol.
public:
virtual property System::Drawing::Color BorderColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public override System.Drawing.Color BorderColor { get; set; }
member this.BorderColor : System.Drawing.Color with get, set
Public Overrides Property BorderColor As Color
Nilai Properti
Yang Color berisi warna batas. Warna defaultnya adalah Gray.
Contoh
Contoh kode berikut menunjukkan penggunaan BorderColor deklaratif properti pada WebPartZone kontrol. Untuk contoh kode lengkap, termasuk file sumber code-behind dan halaman .aspx yang berisi zona dalam kode ini, lihat WebPartZoneBase gambaran umum kelas.
Perhatikan bahwa BorderColor atribut diatur ke warna bernama tertentu. Setelah Anda memuat halaman ke browser dan mengalihkan halaman ke mode tampilan desain, Anda dapat melihat efek properti .
<asp:WebPartZone
ID="WebPartZone2"
Runat="server"
DragHighlightColor="#00ff00"
AllowLayoutChange="true"
EmptyZoneText="Add WebParts to this empty Zone."
BorderWidth="2"
BorderColor="DarkBlue"
BorderStyle="Dashed"
MenuLabelText="Verbs Menu"
MenuPopupImageUrl="label.gif" >
<VerbStyle Font-Italic="true" />
<MenuLabelStyle BackColor="Lime" BorderWidth="1" />
<MenuLabelHoverStyle Font-Bold="true" />
<MenuVerbHoverStyle BackColor="LightGrey" />
<MenuVerbStyle Font-Italic="true" />
<ZoneTemplate>
<asp:Label ID="Label1" Runat="server" Title="Date" />
</ZoneTemplate>
</asp:WebPartZone>
<asp:WebPartZone
ID="WebPartZone2"
Runat="server"
DragHighlightColor="#00ff00"
AllowLayoutChange="true"
EmptyZoneText="Add WebParts to this empty Zone."
BorderWidth="2"
BorderColor="DarkBlue"
BorderStyle="Dashed"
MenuLabelText="Verbs Menu"
MenuPopupImageUrl="label.gif" >
<VerbStyle Font-Italic="true" />
<MenuLabelStyle BackColor="Lime" BorderWidth="1" />
<MenuLabelHoverStyle Font-Bold="true" />
<MenuVerbHoverStyle BackColor="LightGrey" />
<MenuVerbStyle Font-Italic="true" />
<ZoneTemplate>
<asp:Label ID="Label1" Runat="server" Title="Date" />
</ZoneTemplate>
</asp:WebPartZone>
Keterangan
Properti dasar BorderColor ditimpa oleh WebPartZoneBase kelas untuk mengatur warna default untuk batas zona.
Anda dapat mengatur BorderColor properti untuk WebPartZoneBase kontrol baik secara deklaratif atau terprogram. Batas hanya muncul saat zona berada dalam mode tampilan halaman di mana WebPartZoneBase fitur antarmuka pengguna kelas (UI) terlihat, seperti EditDisplayMode atau DesignDisplayMode.