Tech Off Post

Single Post Permalink

View Thread: WPF : anchor doesn't work?
  • User profile image
    Cannot​Resolve​Symbol

    turrican said:
    jh71283 said:
    *snip*
    Thanks, it worked. But omfg, WPF sucks big time so far. Totally unnatural/unlogical compared to what "we are used to" from winforms.
    FWIW, if you don't specify a width at all (and no other positioning/sizing properties besides the height and vertical alignment at the bottom), WPF will make the status bar automatically resize like you'd expect it to.  This is the XAML generated by Blend for a window only containing a status bar, and it resizes as expected:

    <Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        x:Class="TestStatusbar.Window1"
        x:Name="Window"
        Title="Window1"
        Width="640" Height="480">

        <Grid x:Name="LayoutRoot">
            <StatusBar VerticalAlignment="Bottom" Height="26" Background="#FF5F7CAD"/>
        </Grid>
    </Window>