MenuItemStyle.ItemSpacing 속성

정의

MenuItemStyle 개체가 적용되는 메뉴 항목과 그 주변 메뉴 항목 사이의 세로 간격 크기를 가져오거나 설정합니다.

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

속성 값

MenuItemStyle 개체가 적용되는 메뉴 항목과 주변 메뉴 항목 사이의 세로 간격 크기(픽셀)입니다. 기본값은 0입니다.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 ItemSpacing 5 픽셀 그 주변 메뉴 항목에서 메뉴 항목을 구분 하는 속성입니다.


<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>MenuItemStyle ItemSpacing Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>MenuItemStyle ItemSpacing Example</h3>
      
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        runat="server">
        
        <staticmenuitemstyle backcolor="LightBlue"/>
        <dynamicmenuitemstyle itemspacing="5"
          backcolor="LightBlue"/>
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </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">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>MenuItemStyle ItemSpacing Example</title>
</head>
<body>
    <form id="form1" runat="server">
    
      <h3>MenuItemStyle ItemSpacing Example</h3>
      
      <asp:menu id="NavigationMenu"
        staticdisplaylevels="2"
        staticsubmenuindent="10" 
        orientation="Vertical"
        runat="server">
        
        <staticmenuitemstyle backcolor="LightBlue"/>
        <dynamicmenuitemstyle itemspacing="5"
          backcolor="LightBlue"/>
      
        <items>
          <asp:menuitem text="Home"
            tooltip="Home">
            <asp:menuitem text="Music"
              tooltip="Music">
              <asp:menuitem text="Classical"
                tooltip="Classical"/>
              <asp:menuitem text="Rock"
                tooltip="Rock"/>
              <asp:menuitem text="Jazz"
                tooltip="Jazz"/>
            </asp:menuitem>
            <asp:menuitem text="Movies"
              tooltip="Movies">
              <asp:menuitem text="Action"
                tooltip="Action"/>
              <asp:menuitem text="Drama"
                tooltip="Drama"/>
              <asp:menuitem text="Musical"
                tooltip="Musical"/>
            </asp:menuitem>
          </asp:menuitem>
        </items>
      
      </asp:menu>

    </form>
  </body>
</html>

설명

사용 하 여는 ItemSpacing 는 메뉴 항목 사이의 세로 간격 크기를 제어 하려면 속성을 MenuItemStyle 개체를 적용 하 고 동일한 수준에서 그 주변 메뉴 항목입니다. 현재 메뉴 항목의 위쪽 가장자리 사이의 현재 메뉴 항목의 아래쪽 가장자리와 다음 메뉴 항목의 위쪽 가장자리 사이의 뿐만 아니라 이전 메뉴 항목의 아래쪽 가장자리에이 공백을 삽입 합니다.

참고

첫 번째 메뉴 항목에 대 한 위쪽 공간이 렌더링 되지 않습니다는 Menu 제어 합니다.

적용 대상

추가 정보