O'Reilly logo

Silverlight™ 4 For Dummies® by Mahesh Krishnan, Phillip Beadle

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 5. Laying Out Controls

In This Chapter

  • Working with container controls

  • Displaying things in a tabular way

  • Stacking up controls the easy way

  • Laying out controls with absolute positioning using the Canvas control

  • Using the ScrollViewer to view more of the control

  • Using the Viewbox to squeeze controls into a given space

  • Grouping controls together in tabs

  • Docking controls

Designing a good user interface includes paying close attention to how the contents of your screen are organized and laid out. You can lay out the user interface elements using absolute positioning, which means to specify the exact position an element should occupy. This approach is not always practical, however, because your users may have different screen resolutions and may even run the application on a variety of devices. Uh-oh, did we say a variety of devices? Yes, it's true: Remember that Silverlight actually runs on a browser, and the plug-in can be ported to different devices, including mobile phones.

Laying out your controls on your screen with a range of devices in mind therefore presents a challenge. Thankfully, Silverlight contains a range of layout containers — controls that help you manage the way your on-screen controls are laid out. In this chapter, we look at a few of the commonly used containers and how they can be used to control the layout of the screen.

Understanding Layout Containers

A container in Silverlight is simply a control that can contain other user interface elements (or controls). The controls ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required