   [.net] WPF Window - DockPanel overflowing the window?
  Hi Guys - I have a program that shows various Page objects inside a NavigatorWindow.  I'm currently running into a problem with one of my Pages - it doesn't seem to be properly sizing content within its width/height; the controls are overflowing, even though the controls' contents are currently empty!Here is my XAML for the current page:<Page x:Class="OptionsMenuPage"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    Title="OptionsMenu"    Style="{StaticResource MenuPage}">    <DockPanel>   <StackPanel VerticalAlignment="Bottom" DockPanel.Dock="Left" Width="120">  <Button Name="buttonAccept">Accept</Button>  <Button Name="buttonCancel">Cancel</Button>   </StackPanel>   <TabControl Name="tabControl">  <TabItem Name="tabOptions1" Header="Options1"> <DockPanel><StackPanel Orientation="Horizontal" DockPanel.Dock="Top">    <Label>Selected Scoring System:</Label>    <ComboBox Name="comboSelectSomething" Width="250" /></StackPanel><GroupBox Header="Options for Current Selected Thing">    <Canvas /></GroupBox> </DockPanel>  </TabItem>   </TabControl>    </DockPanel></Page>For reference, here is the page style resource, in case it mattered:<Style x:Key="MenuPage" TargetType="Page">    <Setter Property="Background" Value="Transparent" />    <Setter Property="MinHeight" Value="500" />    <Setter Property="MinWidth" Value="600" /></Style>FYI - the parent NavigatorWindow has the same MinWidth/MinHeight.In the VS designer window, everything looks fine; the tab content fills the page exactly.  When running/debugging however, the buttons on the left cant be seen unless I drag the window border to enlarge it.  The same goes for the group box - the right-most and bottom-most border overflow past the window border.If I enlarge the window, the overflowed controls become visible; if I continue to enlarge the window, the controls automatically fill the extra space (which is what I want - that's good).  The problem is when I shrink the window down to its MinHeight and MinWidth - the stackpanel buttons and the groupbox border overflow.What am I doing wrong, here?[Edited by - BTownTKD on April 19, 2010 6:43:24 AM]
  You have set the Page's minimum size to 600/500 in your style, so the Page doesn't get any smaller than that... Even if your window is only 400 pixels in height, the Page is still 500 which is why you can't see your buttons.So you can either set the minimum size on the navigator window instead, or make the page's minimum size smaller or put your content inside a ScrollViewer.   ;  That would make sense normally, but I currently have the NavigatorWindow and the Page both set to the same minimum height/width.I can try to set the parent window's minSize to be larger when I get home; but the overflow seems to be at least 20-40 pixels, which seems like a lot, considering the sizes are supposed to be equal already.   ;  Oh I see.. hope I understood you correctly this time; The window size includes the window's header and border so the actual space available inside it is less than that. If you set the minimum size on the layout root control inside the window and not on the window itself it should work.   ;  Ahhh that makes perfect sense.  Thank you!  I'll give it a try tonight.   