O'Reilly logo

Professional Visual Basic® 2010 and .NET 4 by Kent Sharkey, Rob Windsor, Gastón C. Hillar, Jonathan Marbutt, Billy Hollis, Bill Sheldon

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 15. Advanced Windows Forms

WHAT YOU WILL LEARN IN THIS CHAPTER

  • How to inherit from existing Windows Forms controls and extend them for your own purposes

  • How to create UserControls that combine controls into a reusable surface

  • How to create Windows Forms controls that draw their own interface

The previous chapter discussed the basics of Windows Forms 2.0. These capabilities are sufficient for straightforward user interfaces for systems written in VB 2010; but as applications become larger and more complex, it becomes more important to use the advanced capabilities of the .NET environment to better structure the application. Poorly structured large systems tend to have redundant code. Repeated code patterns end up being used (in slightly different variations) in numerous places in an application, which has numerous bad side effects: longer development time, less reliability, more difficult debugging and testing, and tougher maintenance.

Examples of needs that often result in repeated code include ensuring that fields are entered by the user, that the fields are formatted correctly, and that null fields in the database are handled correctly. Proper object-oriented design can encapsulate such functionality, making it unnecessary to use repeated code. Using the full object-oriented capabilities of the .NET environment, plus additional capabilities specific to Windows Forms programming, you can componentize your logic, enabling the same code to be used in numerous places in your application. ...

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