Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#WinForm
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
 
Sri
Posted 31-Jan-13 16:52pm

1 solution

Rate this: bad
good
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[^].
 
—SA
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 800
1 OriginalGriff 503
2 Abhinav S 253
3 thatraja 245
4 Emre Ataseven 200
0 Sergey Alexandrovich Kryukov 8,282
1 OriginalGriff 4,750
2 Peter Leow 3,784
3 Maciej Los 3,515
4 Er. Puneet Goel 3,107


Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 31 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid