Visible Objects: Creating Your First User Control
In the previous set of lessons you learned how to work with classes—blueprints for objects. The classes that you created can be reused in other programs, so you don't have to write the same code over and over again.
Controls are also classes that can be reused in multiple projects. You will probably find yourself designing the same user interface over and over again—for example, adding TextBox controls for entering first and last names, and then adding code to combine them into a full name. Wouldn't it be nice if you could avoid all of that extra work?
That's where user controls come in. You can think of a user control as a class for creating visible objects—your own custom controls that can be reused just like the controls that come with Visual Basic 2005. Most user controls are composite controls —that is, controls that are composed of one or more standard Visual Basic 2005 controls.
In the following lessons, you will learn how to create a composite user control that you can reuse in other programs.
In This Section