WebPartZoneBase.BorderWidth 属性

定义

获取或设置环绕 WebPartZoneBase 控件的边框的宽度。

public:
 virtual property System::Web::UI::WebControls::Unit BorderWidth { System::Web::UI::WebControls::Unit get(); void set(System::Web::UI::WebControls::Unit value); };
public override System.Web.UI.WebControls.Unit BorderWidth { get; set; }
member this.BorderWidth : System.Web.UI.WebControls.Unit with get, set
Public Overrides Property BorderWidth As Unit

属性值

环绕区域的边框的宽度(以指定的 Unit 为单位)。 默认值为 1。

示例

下面的代码示例演示了 对控件的 属性WebPartZoneBorderWidth声明性使用。 有关完整的代码示例(包括代码隐藏源文件和包含此代码中的区域的 .aspx 页),请参阅 WebPartZoneBase 类概述。

请注意, BorderWidth 属性值设置为特定宽度(以像素为单位)。 将页面加载到浏览器中并将页面切换到设计显示模式后,可以看到 属性的效果。

<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>

注解

BorderWidth 属性由 WebPartZoneBase 类重写,以设置区域的默认边框宽度。

可以通过声明方式或编程方式设置BorderWidthWebPartZoneBase控件的 属性。 仅当区域处于页面显示模式时,边框才会显示,其中 WebPartZoneBase 类用户界面 (UI) 功能可见,例如 EditDisplayModeDesignDisplayMode

适用于

另请参阅