What You’ll Learn in This Hour:
. Adding controls to a form
. Positioning, aligning, sizing, spacing, and anchoring controls
. Creating intelligent tab orders
. Adjusting the z-order of controls
. Creating transparent forms
. Creating forms that always float over other forms
. Creating multiple document interfaces
A form is just a canvas, and although you can tailor a form by setting its properties, you
need to add controls to it to make it functional. In the previous hour, you learned how to
add forms to a project, set basic form properties, and show and hide forms. In this hour,
you’ll learn all about adding controls to a form, including arranging and aligning con-
trols to create an attractive and functional interface. You’ll also learn how to create
advanced multiple document interfaces (MDIs) as used in applications such as Photoshop.
After you complete the material in this hour, you’ll be ready to learn the details about the
various controls available in Visual C#.
Working with Controls
Controls are the objects that you place on a form for users to interact with. If you’ve fol-
lowed the examples in the previous hours, you’ve already added controls to a form.
However, you’ll be adding a lot of controls to forms, and it’s important for you to under-
stand all aspects of the process. After you learn about forms in this hour, the next two
hours teach you the ins and outs of the powerful controls provided by Visual C#.
HOUR 6: Building Forms—Advanced Techniques
Adding Controls to a Form
All the controls that you can add to a form can be found in the toolbox. The tool-
box appears as a docked window on the left side of the design environment by
default. This location is useful when you’re only occasionally adding controls to
forms. However, when doing serious form-design work, I find it best to dock the tool-
box to the right edge of the design environment, where it doesn’t overlap so much
(if any) of the form I’m working with.
Remember that before you can undock a t