Summary


This chapter discussed how to create custom controls in VB.NET, and illustrated how much easier it is to do this compared with previous versions of Visual Basic. The advent of full inheritance capabilities in VB.NET means that it is a lot easier for developers to utilize functionality simply by inheriting from the namespaces built into the .NET Framework. It is probably best to start by overriding these existing controls in order to learn the basics of creating properties and coordinating them with the designer, building controls and testing them, and so on. These techniques can then be extended by the creation of composite controls, as illustrated by the examples within the chapter.

You have learned how to create controls in the following ways:

  • By inheriting from another control

  • By building a composite control

  • By writing a control from scratch, based on the Control class (although this takes more work than the other two methods)

In the course of writing a control from scratch, it was necessary to discuss the basics of GDI+, but if you are going to do extensive work with GDI+, you will need to seek out additional resources to aid in that effort.

The key concept that you should take away from this chapter is that Windows Forms controls are a great way both to package functionality that will be reused across many forms and to create more dynamic, responsive user interfaces much more quickly with much less code.




Professional VB 2005 with. NET 3. 0
Professional VB 2005 with .NET 3.0 (Programmer to Programmer)
ISBN: 0470124709
EAN: 2147483647
Year: 2004
Pages: 267

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net