![]() ![]() | ||
Panel controls are most often used as—and are intended as—containers for other controls. They're often useful when you want to show or hide a group of controls at once, or when you want to add controls to a Web page in code. In fact, we've already seen how to use panels to add controls to a Web page; see "Adding Controls at Run Time" in Chapter 15. To see how panels are used to group controls, notice the Panels example, which is shown in Figure 16.4. This example presents a very basic color-picker type application, which lets you use radio buttons to select a color. That's a panel I'm using at the bottom of the application you see in Figure 16.4 to display the selected color (using the panel's BackColor property).
If you click the Custom radio button in the Panels example, a panel that was previously hidden appears, as you see in Figure 16.5; you can use all the controls that now appear to set a custom color. I'll go over this example in more depth later in the chapter—see "Creating Panels" for the details.
And those are the controls that this chapter covers. It's time to turn to the Immediate Solutions section of the chapter to start working things out detail by detail.
![]() ![]() | ||