WebControl.Height 속성

정의

웹 서버 컨트롤의 높이를 가져오거나 설정합니다.

public:
 virtual property System::Web::UI::WebControls::Unit Height { System::Web::UI::WebControls::Unit get(); void set(System::Web::UI::WebControls::Unit value); };
[System.ComponentModel.Bindable(true)]
public virtual System.Web.UI.WebControls.Unit Height { get; set; }
public virtual System.Web.UI.WebControls.Unit Height { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.Height : System.Web.UI.WebControls.Unit with get, set
member this.Height : System.Web.UI.WebControls.Unit with get, set
Public Overridable Property Height As Unit

속성 값

컨트롤의 높이를 나타내는 Unit입니다. 기본값은 Empty입니다.

특성

예외

높이가 음수 값으로 설정된 경우

예제

다음 예제에서는 선언적으로 설정 하는 방법을 보여 줍니다는 Height 의 속성을 Table 에서 상속 된 컨트롤은 WebControl 기본 클래스.

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Table Property</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h3>Property of a Table Web Control</h3>
 
        <asp:Table id="Table1" runat="server"
            CellPadding = "10" 
            CellSpacing="0"
            GridLines="Both"
            Height="300">

            <asp:TableRow>
                <asp:TableCell>
                    Row 0, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 0, Col 1
                </asp:TableCell>
            </asp:TableRow>

            <asp:TableRow>
                <asp:TableCell>
                    Row 1, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 1, Col 1
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
    </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">

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Table Property</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h3>Property of a Table Web Control</h3>
 
        <asp:Table id="Table1" runat="server"
            CellPadding = "10" 
            CellSpacing="0"
            GridLines="Both"
            Height="300">

            <asp:TableRow>
                <asp:TableCell>
                    Row 0, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 0, Col 1
                </asp:TableCell>
            </asp:TableRow>

            <asp:TableRow>
                <asp:TableCell>
                    Row 1, Col 0
                </asp:TableCell>
                <asp:TableCell>
                    Row 1, Col 1
                </asp:TableCell>
            </asp:TableRow>
        </asp:Table>
    </div>
    </form>
</body>
</html>

설명

사용 된 Height 속성을 통해 웹 서버 컨트롤의 높이 지정 합니다.

참고

이 속성 브라우저에서 모든 컨트롤에 대 한 Microsoft Internet Explorer 버전 4 이전의 렌더링 하지 않습니다. 이전 브라우저에서이 속성은 렌더링 되지 않는 컨트롤에 포함 Label, HyperLink, LinkButton, 및 유효성 검사 컨트롤입니다. CheckBoxList, RadioButtonListDataList 도 이전 브라우저에서이 속성은 렌더링 되지 않는 경우 해당 RepeatLayout 속성이 RepeatLayout.Flow. 또한 단위 유형만 PixelPercentage 이전 브라우저에서 지원 됩니다.

이 속성의 비표준 HTML 이기 때문에 웹 서버 등의 컨트롤 표시 하는 테이블로 TableDataGrid를 지원 하지 않습니다이 속성 브라우저에서 Microsoft Internet Explorer 버전 4 이전의 합니다.

참고

설정 하는 Height 단위에는 속성의 기본값 이외의 형식이 Pixel, 단위 유형을 새로 만들어야 합니다. 예를 들어, 컨트롤을 설정 하려면 Height 속성 100 사이의 백분율 값으로 다음을 수행할 수 있습니다.

myWebControl.Width = Unit.Percentage(100);

에 사용할 수 있는 장치 유형에 대 한 자세한 내용은 합니다 Height 속성 참조는 Unit 클래스입니다.

적용 대상

추가 정보