432
|
Chapter 13, Enhancing Visual Studio
#95 View an Outline of Your Controls
HACK
HACK
#95
View an Outline of Your Controls Hack #95
Drill-down, select, and drag ‘n’ drop all your controls, even on the most
complicated forms.
In Windows Forms development, a large number of controls contain other
controls. The
GroupBox control can be used to group a number of controls
together, particularly useful when working with radio buttons. A
Panel con-
trol can be used to host controls, organize them, control their visibility, and
more. One of the confusing parts of Windows Forms development is keep-
ing track of all of these controls, where they are, and what control they are
contained in.
A freely available power toy from Microsoft called the Control Outline
makes this task a lot easier. You can get it from http://www.gotdotnet.com/
team/ide.
After installing and enabling the power toy, you will have a new window
that shows all of your controls in an easy-to-read and -understand outline.
You can access this window from View
Other Windows Control Out-
line. This window can be seen in Figure 13-14.
As you can see, it is very easy to quickly look at the outline and determine
where a control is in the container hierarchy. You can also click on a con-
trol in this outline, and it will be selected on your form, which helps when
you have nested a number of controls. It is hard to select these kinds of con-
trols in the designer.
This power toy also includes a couple of other very useful features. You can
select a control in the Control Outline and click the Delete button to remove
the control from the form. On top of that, you can drag and drop controls
around the control outline. In the example shown in Figure 13-14, you
could drag
button3 outside of the groupbox1 control and drop it on the
panel1 control. This would move that control, and any controls nested
Figure 13-14. Control Outline window

Get Visual Studio Hacks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.