O'Reilly logo

Pro WPF in C# 2008: Windows Presentation Foundation with .NET 3.5, Second Edition by Matthew MacDonald

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

Extending an Existing Control

Most of the time when you build a custom element, you'll derive from one of the base classes listed in Table 24-1, such as FrameworkElement, Control, ContentControl, or Panel. In some cases, however, you might be able to tweak an existing control so that it does what you want.

One example is the basic WPF TextBox, which can be enhanced it countless ways. In this section, you'll learn how to create a text box that approximates the MaskedTextBox from the Windows Forms world, which has no WPF equivalent.

Understanding Masked Edit Controls

A masked text box is a text box that automatically formats input as it's entered. For example, if you type 1234567890 into a masked edit control that uses a U.S. telephone number ...

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