다음을 통해 공유


TitleStyle.Wrap 속성

정의

파트 컨트롤의 제목 표시줄 내용이 제목 표시줄에서 줄 바꿈되는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 virtual property bool Wrap { bool get(); void set(bool value); };
public override bool Wrap { get; set; }
member this.Wrap : bool with get, set
Public Overrides Property Wrap As Boolean

속성 값

Boolean

제목 표시줄의 내용이 제목 표시줄에서 줄 바꿈되면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.

예제

다음 코드 예제에서는 속성의 선언적 사용을 보여 줍니다 Wrap . 다음 페이지의 <asp:calendar> 코드에서 요소와 <asp:label> 요소가 영역 내에 나타나며, 해당 컨트롤은 런타임에 정품 웹 파트 기능을 제공합니다.

여러 스타일 특성이 <parttitlestyle> 포함된 요소는 영역에 포함된 두 웹 파트 컨트롤의 제목 표시줄에 적용됩니다. 또한 요소 wrap 에는 <parttitlestyle> 특성이 있습니다width. Wrap 속성 값이 설정true되고 두 컨트롤의 제목 표시줄에 있는 텍스트가 특성에 할당된 값보다 넓기 width 때문에 페이지가 브라우저에 로드될 때 각 컨트롤의 제목 표시줄 텍스트가 줄 바꿈됩니다.

<%@ 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 id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server"
      title="Zone 1">
        <parttitlestyle 
          font-bold="true" 
          BorderWidth="2" 
          ForeColor="#3300cc" 
          wrap="true" Width="100"/>
        <partstyle
          borderwidth="1px"   
          borderstyle="Solid"  
          bordercolor="#81AAF2" />
        <zonetemplate>
          <asp:calendar 
            ID="cal1" 
            Runat="server" 
            Title="My Calendar" />
          <asp:Label id="label1" runat="server" 
            Title="A WebPart Label">
            The label control acts as a WebPart.
          </asp:Label>
          </zonetemplate>
    </asp:webpartzone>
  </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 id="Head1" runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
  <form id="Form1" runat="server">
      <asp:webpartmanager id="WebPartManager1" runat="server" />
    <asp:webpartzone
      id="WebPartZone1"
      runat="server"
      title="Zone 1">
        <parttitlestyle 
          font-bold="true" 
          BorderWidth="2" 
          ForeColor="#3300cc" 
          wrap="true" Width="100" />
        <partstyle
          borderwidth="1px"   
          borderstyle="Solid"  
          bordercolor="#81AAF2" />
        <zonetemplate>
          <asp:calendar 
            ID="cal1" 
            Runat="server" 
            Title="My Calendar" />
          <asp:Label id="label1" runat="server" 
            Title="A WebPart Label">
            The label control acts as a WebPart.
          </asp:Label>
          </zonetemplate>
    </asp:webpartzone>
  </form>
</body>
</html>

설명

클래스는 TitleStyle 값을 false설정할 수 있도록 기본 Wrap 속성을 재정의합니다. 기본적으로 TitleStyle 파트 컨트롤의 Wrap 제목 표시줄에서 해당 내용을 래핑할 수 없도록 속성을 false설정합니다.

적용 대상

추가 정보