C1Sizer and C1Sizer Light
I started with one of the smaller tools, but one which looked as though it would help resolve a common problem.This is the C1Sizer component.Although the Dock and Anchor properties built in to Visual Studio .NET 2005 are much improved,I still find that the individual tweaking of the size and relative position of controls as a form is being resized can still be a pain.
The Sizer components are designed to take away that aggravation.From the small test projects I created to try these components out, I can tell you that they succeeded in doing so very impressively.
Beginning with the SizerLight component, I added it to the toolbox in a solution I had created previously.With a form containing standard Winforms controls the component worked perfectly straight out of the box.All controls were resized as you would wish, no overlaps, no ugly text displays.It functioned properly whether I used the Resize handles on the form at Run Time or if I clicked the Maximize and Minimize buttons.
I had the odd tricky moment when I then tried to use Sizer Light in a Windows Form which contained some user controls I had created.Dragging via the resize handles was fine, but I got some very strange end results after I maximized or minimized-then-restored the form.However, ever optimistic, I ran the project through the Publish Wizard, installed it on my development machine and was pleased to see that all the resizes worked just fine, including the user controls.I guess it must just have been one of those VS Design Time graphics glitches that occur from time to time.
This component really does take the pain out of all that Dock and Anchor fiddling and is absolutely simple to use.
I then moved on to the more sophisticated C1Sizer component.This offers you far greater flexibility and an almost infinite level of detail.At the basic level, this component allows you to break your Windows Form UI into a grid layout:
You drag controls to where you want them, moving them around until you have the layout you want.You can add, remove or change the location of the bars which form the cells inside the grid.As you alter the size of a cell that contains a control, so the contained control will change in size correspondingly.
In many situations, one C1Sizer docked to Fill the whole form will be all you need (which is what is demonstrated in the screenshot above).However while I was experimenting I also found that I had much better results if I didn’t use the standard Windows Forms Panels within a C1Sizer Grid to contain sub groups of controls.Simply using the SizerGrid itself as a kind of Super Panel was much better and was a habit I found it easy to adopt within a very short time.I simply placed other C1Sizers within the one which was Docked to fill the Form.The child C1Sizers could then be used in the same way as you would use a panel.A wheels-within-wheels kind of approach.In this way you have deeper levels of control when it comes to resizing options and also a range of methods,such as enumerating through all controls in a (child) Sizer, are available to you.
The downloadable PDF manual for this component is detailed and logically arranged with information for users at all levels.Even the basics are not overlooked, as for example right at the start of the manual they explain to the absolute beginner how to add a component to the Visual Studio toolbox.
The manual contains samples, a quick tutorial for the early stages, plus a comprehensive reference at the end which allows for the more seasoned developer to get right into the bones of it.
This really is a very useful component indeed.