Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there no built in C# GUI Layouts?

I'm used to the GUI frameworks in Java as well as the QT GUI framework, and I'm used to the various layout managers. It doesn't seem that C# has any layout managers built in, or am I missing something?

2 Year Later Edit

I just want to point out to any readers of this question that in hind-sight, my question was misplaced. With proper anchoring and docking of child controls, having a need for the layout managers of Java and QT4 is nearly non-existent.

like image 730
Anthony Avatar asked Nov 30 '10 17:11

Anthony


3 Answers

WPF does have layout managers, see:

http://msdn.microsoft.com/en-us/library/ms745058.aspx

If you're coming from a Java background, then the section "Panel Elements and Custom Layout Behaviors" will be of particular interest.

like image 197
Tim Lloyd Avatar answered Oct 15 '22 06:10

Tim Lloyd


Both WPF and Windows Forms provide layout capabilities (WPF is just much better at it).

You can achieve moderately complex layouts in Windows Forms too by utilizing the Dock and Anchor properties of controls. Personally I learned what can be achieved and how through Petzold's book on WinForms. If you don't have access to that book, read this short article.

like image 44
Jon Avatar answered Oct 15 '22 06:10

Jon


chibacity is right, WPF is loaded with layout managers, all of them are very good.

However if you're going down the WinForms route, you're stuck with TableLayoutPanel, FlowLayoutPanel and SplitContainer. As well as the usual manual Panel and GroupBox controls.

like image 35
Tom Avatar answered Oct 15 '22 06:10

Tom