Control.VerticalContentAlignment 속성


컨트롤 콘텐츠의 세로 맞춤을 가져오거나 설정합니다.Gets or sets the vertical alignment of the control's content.

 property System::Windows::VerticalAlignment VerticalContentAlignment { System::Windows::VerticalAlignment get(); void set(System::Windows::VerticalAlignment value); };
public System.Windows.VerticalAlignment VerticalContentAlignment { get; set; }
member this.VerticalContentAlignment : System.Windows.VerticalAlignment with get, set
Public Property VerticalContentAlignment As VerticalAlignment

속성 값


VerticalAlignment 값 중 하나입니다.One of the VerticalAlignment values. 기본값은 Top입니다.The default is Top.



다음 예제에서는 컨트롤에 세로 콘텐츠 맞춤 속성을 설정 하는 방법을 보여 줍니다.The following example shows how to set the vertical content alignment property on a control.

<Button Name="btn8" Height="50"
void ChangeVerticalContentAlignment(object sender, RoutedEventArgs e)
    if (btn8.VerticalContentAlignment == VerticalAlignment.Top)
        btn8.VerticalContentAlignment = VerticalAlignment.Bottom;
        btn8.Content = "Control vertical alignment changes from top to bottom.";
        btn8.VerticalContentAlignment = VerticalAlignment.Top;
        btn8.Content = "VerticalContentAlignment";
Private Sub ChangeVerticalContentAlignment(ByVal Sender As Object, ByVal e As RoutedEventArgs)

    If (btn8.VerticalContentAlignment = VerticalAlignment.Top) Then

        btn8.VerticalContentAlignment = VerticalAlignment.Bottom
        btn8.Content = "Control vertical alignment changes from top to bottom."


        btn8.VerticalContentAlignment = VerticalAlignment.Top
        btn8.Content = "VerticalContentAlignment"
    End If
End Sub


외에 Top, Bottom, 및 Center를 설정할 수 있습니다 합니다 VerticalContentAlignment 속성을 Stretch, 부모 요소의 할당 된 레이아웃 공간을 채우기 위해 자식 요소를 늘여는 합니다.In addition to Top, Bottom, and Center, you can set the VerticalContentAlignment property to Stretch, which stretches the child element to fill the allocated layout space of the parent element. 자세한 내용은 맞춤, 여백 및 안쪽 여백 개요합니다.For more information, see Alignment, Margins, and Padding Overview.

이 속성에만 해당 템플릿을 사용 하 여 컨트롤을 적용 합니다 VerticalContentAlignment 매개 변수로 속성입니다.This property only affects a control whose template uses the VerticalContentAlignment property as a parameter. 다른 컨트롤에 대해이 속성이 아무런 영향이 없습니다.On other controls, this property has no impact.

종속성 속성 정보Dependency Property Information

식별자 필드Identifier field VerticalContentAlignmentProperty
메타 데이터 속성 설정 trueMetadata properties set to true 없음None

적용 대상