Implementing a Custom Windows Control

As mentioned earlier, components do not have a visual aspect at runtime; controls do. You can create a custom control by defining a new control that inherits from System.Windows.Forms.Control or an existing control, like the TextBox control. If you want to create a brand new control, inherit from the Control class. Intuitively it will be easier to create a control if you inherit from one that already has much of the functionality you need.

Defining a Regular Expression TextBox Control

You may use a Validating event to write code to validate the value of a TextBox control. Using an event handler is convenient for general purpose validation; however, if you find yourself using a specific kind of validation ...

Get Visual Basic® .NET Power Coding now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.