WebPartZoneBase.MenuLabelText 屬性

定義

取得或設定值,做為區域中各個 WebPart 控制項標題列之動詞命令下拉式功能表的標籤。

public:
 virtual property System::String ^ MenuLabelText { System::String ^ get(); void set(System::String ^ value); };
public virtual string MenuLabelText { get; set; }
member this.MenuLabelText : string with get, set
Public Overridable Property MenuLabelText As String

屬性值

字串,包含顯示於動詞命令功能表之標籤中的文字。 預設為空字串 ("")。

範例

下列程式碼範例示範 控制項上 WebPartZone 屬性的 MenuLabelText 宣告式用法。 如需完整的程式碼範例,包括程式碼後置原始程式檔和包含此程式碼中區域的 .aspx 頁面,請參閱 WebPartZoneBase 類別概觀。

請注意, MenuLabelText 屬性具有在宣告式標記中指派給它的值。 這個值會影響 WebPartZone2 。 將頁面載入瀏覽器之後,請將頁面切換為編輯模式,並注意到 中的 WebPartZone2 動詞功能表標籤文字是在宣告式標記中指派給它的值。

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

備註

MenuLabelText如果屬性被指派值,標籤就會與影像一起顯示,該影像代表區域中每個控制項標題列中的 WebPart 動詞下拉式功能表。 如果未將任何值指派給 屬性,則只會在功能表上顯示影像。

設定時,這個屬性的值可以使用設計工具自動儲存到資源檔。 如需詳細資訊,請參閱 LocalizableAttribute全球化和當地語系化

適用於

另請參閱