Simple grid layout question

Posted by Matt H. on Stack Overflow See other posts from Stack Overflow or by Matt H.
Published on 2010-03-31T20:06:46Z Indexed on 2010/03/31 20:13 UTC
Read the original article Hit count: 422

Filed under:
|
|
|

I can't believe I'm back to this after working with WPF for 3 months :)

Consider very common setup:

How do I configure the rowheights so that the top and bottom rows (menu bar and status bar) size to fit the height of their content, and the middle row (main content), fills the remaining available space in the program?

I can't fix the height of the top/bottom rows because the height of their content can vary.

<Window>
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition/>
      <RowDefinition/>
       <RowDefinition/>
    </Grid.RowDefinitions>

  <Menu Grid.Row=0>
  ...menuitems
  </Menu>

      <Grid Grid.Row=1>
       ...main application content here (like most programs)
      </Grid>

      <StatusBar>
      ...statusbaritems
      </StatusBar>
   </Grid>
</Window>

© Stack Overflow or respective owner

Related posts about wpf

Related posts about grid