Monday 13 October 2008

Getting your Head Around Layout Management in Visual C#

Layout management is tricky business in Visual C#. People have written Java-style layout managers to address this problem. Take a look at Matthew Johnson's article. According to MSDN, you can achieve great layouts using just Anchor and Dock properties (not totally true). Anchor locks your control in one region of the form, Dock is similar but allows for dynamic resizing of the control. So what can MJ do that Anchor and Dock cannot do? BorderLayout (NSWE, Center), GridLayout, FlowLayout. Not satisfied? Hungry for more on Layout Managers? Read another blog about Layout Managers this time focusing on WPF. Hey, he missed out VirtualizingStackPanel from System.Windows.Controls! (the "control classes" are at the "core of the user's experience with any application" (Quote: MSDN)).

No comments: