Share via


DesignerAutoFormatStyle.VerticalAlign 속성

정의

연결된 컨트롤 내용의 세로 맞춤을 가져오거나 설정합니다.

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

속성 값

VerticalAlign

VerticalAlign 값 중 하나입니다. 기본값은 NotSet입니다.

예제

다음 코드 예제에 사용 하는 방법을 보여 줍니다.는 DesignerAutoFormat 개체 및 Style 속성을 컨트롤에 서식을 적용 합니다.

// Applies styles based on the Name of the AutoFormat
public override void Apply(Control inLabel)
{
    if (inLabel is IndentLabel)
    {
        IndentLabel ctl = (IndentLabel)inLabel;

        // Apply formatting according to the Name
        if (this.Name == "MyClassic")
        {
            // For MyClassic, apply style elements directly to the control
            ctl.ForeColor = Color.Gray;
            ctl.BackColor = Color.LightGray;
            ctl.Font.Size = FontUnit.XSmall;
            ctl.Font.Name = "Verdana,Geneva,Sans-Serif";
        }
        else if (this.Name == "MyBright")
        {
            // For MyBright, apply style elements to the Style property
            this.Style.ForeColor = Color.Maroon;
            this.Style.BackColor = Color.Yellow;
            this.Style.Font.Size = FontUnit.Medium;

            // Merge the AutoFormat style with the control's style
            ctl.MergeStyle(this.Style);
        }
        else
        {
            // For the Default format, apply style elements to the control
            ctl.ForeColor = Color.Black;
            ctl.BackColor = Color.Empty;
            ctl.Font.Size = FontUnit.XSmall;
        }
    }
}
' Applies styles based on the Name of the AutoFormat
Public Overrides Sub Apply(ByVal inLabel As Control)
    If TypeOf inLabel Is IndentLabel Then
        Dim ctl As IndentLabel = CType(inLabel, IndentLabel)

        ' Apply formatting according to the Name
        If Me.Name.Equals("MyClassic") Then
            ' For MyClassic, apply style elements directly to the control
            ctl.ForeColor = Color.Gray
            ctl.BackColor = Color.LightGray
            ctl.Font.Size = FontUnit.XSmall
            ctl.Font.Name = "Verdana,Geneva,Sans-Serif"
        ElseIf Me.Name.Equals("MyBright") Then
            ' For MyBright, apply style elements to the Style object
            Me.Style.ForeColor = Color.Maroon
            Me.Style.BackColor = Color.Yellow
            Me.Style.Font.Size = FontUnit.Medium

            ' Merge the AutoFormat style with the control's style
            ctl.MergeStyle(Me.Style)
        Else
            ' For the Default format, apply style elements to the control
            ctl.ForeColor = Color.Black
            ctl.BackColor = Color.Empty
            ctl.Font.Size = FontUnit.XSmall
        End If
    End If
End Sub

설명

사용 된 VerticalAlign 속성을 통해 연결 된 컨트롤 내용의 세로 맞춤을 지정 합니다. 경우는 VerticalAlign 설정이 무시 됩니다, 속성 연결된 된 컨트롤에 적용 되지 않습니다. 세로 맞춤 열거형에 정의 된 값을 참조 하세요. VerticalAlign합니다.

적용 대상

추가 정보