Conclusion

Conclusion

In this chapter, we’ve examined several of the controls that are used with Windows Forms. These controls offer a great deal of functionality that can be leveraged with a relatively small amount of code. For example, the NumericUp­Down, ProgressBar, and PictureBox controls require almost no code if you’re able to accept the default control behavior.

The NumericUpDown and DomainUpDown controls are used to iterate through a range of values. The NumericUpDown control works with numbers, whereas the DomainUpDown control can be used with almost any collection of objects. Another easy-to-use control is the ProgressBar control, which is used to provide a visual representation of the current status of a task. The PictureBox and ImageList controls simplify working with images. The RichTextBox control is similar to the TextBox control, except that it enables text contained inside the control to be formatted in multiple styles. The TabControl control is used to arrange groups of controls on individual pages—which can enable you to display a large number of controls while conserving space.

This chapter also explored anchoring and docking. All controls expose the Anchor and Dock properties, which are used to dynamically resize and position controls on a form. In Chapter 16, we’ll look at three more controls: ListView, TreeView, and Grid. These controls use many of the features we’ve discussed in this chapter. For example, you’ll often find these controls anchored or docked on a form. Also, the TreeView and ListView classes frequently use the ImageList control as an image container.



Part III: Programming Windows Forms