.NET (296) administrative (41) Ajax (42) AngularJS (2) ASP.NET (145) bicycle (2) books (180) browser (8) C# (135) cars (1) chess (29) CodePlex (10) Coma (8) database (49) deployment (3) Entity Framework (2) essay (114) flash/shockwave (2) flex (1) food (3) friend (2) game (20) idea (5) IIS (8) javascript (83) LInQ (2) Linux (6) management (4) manga (43) misc (676) mobile (1) movies (92) MsAccess (1) murder (2) music (64) mysql (1) news (100) permanent (1) personal (68) PHP (1) physics (2) picture (309) places (12) politics (14) programming (507) rant (120) religion (3) science (43) Sharepoint (3) software (58) space (1) T4 (2) technology (12) Test Driven Development (4) translation (2) VB (2) video (98) Visual Studio (45) web design (46) Windows API (8) Windows Forms (3) Windows Server (6) WPF/Silverlight (63) XML (11)

Wednesday, June 24, 2009

How to make a StackPanel stretch vertically to fill the available space

The problem is moot. The StackPanel doesn't work like that. You need to use a DockPanel to make inner children of the Panel stretch vertically and make the Panel fill all available space. The elements inside should have DockPanel.Dock="Top" to fill only the space they require , then no Dock for the element(s) you want to stretch, then DockPanel.Dock="Bottom" for the rest of the elements. That's how you get that "Outlook feel", too.

No comments: