Click here to Skip to main content
13,452,705 members (55,403 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hello Every One

I am very much new to this C# and WinForms. Recently I was programming a WinForms application using C#. I Have a group box in a Window. The when I try to Maximize/ Resize the window. It is missing the alignment of its parent container which is the Window. I tried Anchoring etc., whatever the controls I know to solve this issue. So please let me know whether there is any direct approach or any other approach to solve this problem.

Thanks in Advance

Posted 31-Jan-13 16:52pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The best approach to this is the combination of the properties System.Windows.Forms.Controls.Dock and System.Windows.Forms.Controls.Padding. In certain cases, Anchor is also helpful, but use it with care, as it tends to cause more flicker (essentially, main reason for it is that some native Windows controls wrapped as Forms control classes are very old; they were created when computer performance was no good enough to allow for effective measures against flicker).

Basically, all the design is based on many panels nested in required way, with other controls docked in leaves of such panel tree, without the use of System.Windows.Forms.DockStyle.None.

In my past answer, I provided a rudimentary code sample to illustrate the idea: how to dock button so that it can adjust with the form[^].

Please see also:
Zom Out malfunctions when Screen resolution changes[^],
GUI Apperance - C#.Net[^].


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03-2016 | 2.8.180318.3 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100