Professional VB 2005 with .NET 3.0 (Programmer to Programmer)
As shown in the last chapter, Windows Forms user interfaces are based on using controls. A control is simply a special type of .NET class (just as forms are). As a fully object-oriented programming environment, VB 2005 gives you the capability to inherit and extend classes, and controls are no exception. Therefore, it is possible to create new controls that go beyond what the built-in controls can do.
There are four primary sources of controls for use on Windows Forms interfaces:
-
Controls packaged with the .NET Framework (referred to in this chapter as built-in controls)
-
Existing ActiveX controls that are imported into Windows Forms (these are briefly discussed in Chapter 23)
-
Third-party .NET-based controls from a software vendor
-
Custom controls that are created for a specific purpose in a particular project or organization
If you are able to build your application with controls from the first three categories, so much the better. Using prewritten functionality that serves the purpose is generally a good idea. However, this chapter assumes you need to go beyond such prepackaged functionality.
If you are primarily familiar with versions of Visual Basic before the .NET era (VB6 and earlier), you know that the only technique available then for such packaging was UserControls. While UserControls is also available in Windows Forms (and is much improved), this is only one of several techniques available for writing visual controls.
Категории