Cipher
Cipher

Reputation: 6102

Align children of stack panel

How can the children of the Stack panel be aligned independently? I have an image which is to be aligned to right and a Label which is to be aligned to left. The orientation property of StackPanel is set to "Horizontal".

<StackPanel Orientation="Horizontal" VerticalAlignment="Top">
            <Label x:Name="titleLb" Content="Label 1" />
            <Image Height="37" Name="image1" Width="129" Source="/GUITest;component/Images/logo.png"/>
        </StackPanel>

Upvotes: 1

Views: 1187

Answers (1)

Vinit Sankhe
Vinit Sankhe

Reputation: 19895

EDITED:

        <DockPanel HorizontalAlignment="Stretch">
            <TextBlock Text="123" HorizontalAlignment="Left" DockPanel.Dock="Left"/>
            <TextBlock Text="345" HorizontalAlignment="Right" DockPanel.Dock="Right"/>
        </DockPanel>

Upvotes: 1

Related Questions