advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Download the Code for this Article
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
 

Customize and Extend Windows Forms Controls

Everybody who writes native Windows applications knows that the Windows Forms controls provided by Microsoft are a great time-saver for oft-used interface components such as text boxes and drop-down lists. But sometimes we need a reusable form control that does things Microsoft hasn't pre-built for us. Learn to extend existing Windows Forms controls with custom functions that will save you time.  


advertisement
ith Visual Studio 2005, developing Windows Forms applications has never been easier. In the user interface area, Microsoft has provided much of the needed functionality in the form of Windows Forms controls, such as the familiar Button and TextBox controls. Using the controls greatly simplifies the developmental process—simply drag and drop the controls, configure their properties, and service all the necessary events.

However, despite the comprehensive set of functionality, there are times where you need to enhance the controls with new features. A good example is the TextBox control. As you are probably aware, the TextBox control allows users to input data into your application. But it does not provide any sort of validation (such as verifying that the input data is an email address) and input filtering (such as restricting input to numbers). To do so, you need to write your own custom validation and filtering logic for each individual TextBox control. Imagine how much work it would be if you needed to validate a dozen instances of this control; you'd have to write a lot of repetitive code.


It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?



advertisement