• Products
  • Download
  • Purchase
  • Support
  • Company
Actipro Software company logo
Twitter Follow Actipro RSS Subscribe (RSS Feed)

The Actipro Blog

Tag Cloud

  • aero
  • blog
  • docking
  • editors
  • gauge
  • intelliprompt
  • navigation
  • propertygrid
  • ribbon
  • shared library
  • silverlight
  • syntaxeditor
  • themes
  • views
  • winforms
  • wpf

Latest Twitter News

November 21, 2011 at 11:14 AM
#WPF Studio 2011.2 is out now! Includes enhanced themes for native WPF conrtols and new SyntaxEditor features. http://t.co/uEMCaGPG

September 26, 2011 at 1:25 PM
If you'd like to see our #WPF / #Silverlight SyntaxEditor code editor control ported to Metro, provide feedback here: http://t.co/xXBNIDTi

September 15, 2011 at 8:31 PM
If you want to see SyntaxEditor eventually show up in Win8's #xaml UI, be sure to add your support to this MS thread: http://t.co/FBjz6TuC

August 15, 2011 at 1:47 PM
New SyntaxEditor IntelliPrompt parameter info feature docs/samples ready for the 2011.2 #WPF and #Silverlight releases. http://t.co/ezoYIjv

August 2, 2011 at 2:40 PM
First look at new automated IntelliPrompt parameter info coming to our C#/VB editor control in #WPF / #Silverlight http://t.co/CUz6O1T

Twitter Follow us on Twitter

Month List

  • 2012
    • February (3)
    • January (2)
  • 2011
    • December (2)
    • November (7)
    • October (2)
    • September (1)
    • August (5)
    • July (3)
    • June (6)
    • May (5)
    • April (8)
    • March (4)
    • February (5)
    • January (9)
  • 2010
    • December (9)
    • November (10)
    • October (4)
    • September (8)
    • August (12)
    • July (9)
    • June (7)
    • May (6)
    • April (7)
    • March (6)
    • February (6)
    • January (4)
  • 2009
    • December (2)
    • November (2)
    • October (12)
    • September (3)
    • August (11)
    • July (10)
    • June (6)
    • May (3)
    • April (7)
    • March (6)
    • February (8)
    • January (10)
  • 2008
    • December (10)
    • November (2)
    • October (3)
    • September (5)
    • August (5)
    • July (8)
    • June (4)
    • May (4)
    • April (10)
    • March (8)
    • February (1)
    • January (2)

Category List

  • RSS feed for ActiproActipro (289)
  • RSS feed for Blog SummaryBlog Summary (13)
  • RSS feed for GeneralGeneral (34)
  • RSS feed for In developmentIn development (150)
  • RSS feed for New featuresNew features (140)
  • RSS feed for New productNew product (30)
  • RSS feed for PromotionPromotion (2)
  • RSS feed for SilverlightSilverlight (71)
  • RSS feed for Tips and tricksTips and tricks (4)
  • RSS feed for Visual Studio 2008Visual Studio 2008 (2)
  • RSS feed for Windows FormsWindows Forms (20)
  • RSS feed for Windows VistaWindows Vista (10)
  • RSS feed for WPFWPF (235)
  • RSS feed for XAMLXAML (23)

About Us

Actipro Software is a leading provider of .NET user interface controls for the WPF, Silverlight, and WinForms frameworks, and is most well-known for their SyntaxEditor syntax-highlighting code editor control.

Please take some time to learn more about us and our product offerings.

Sneak Peek: MaskedTextBox in Editors for WPF

January 15, 2009 at 5:46 PM
by Bill Henning (Actipro)

Another control we are working on as part of the Editors for WPF product is the MaskedTextBox control. Built from scratch, this control allows user input to be restricted based on a regular expression pattern.

The regular expression supports simple literals and character classes, in addition to quantifiers (*, +, ?, etc) and alternations (a|b). For example, the following regular expression will match a U.S. phone number with or with a preceding area code or 1:

([(]\d\d\d[)] |(1-)?\d\d\d-)?\d\d\d-\d\d\d\d

Valid entries for this regular expression include:

  • 555-1212
  • (703) 555-1212
  • 703-555-1212
  • 1-703-555-1212

By default, the non-option regex elements will be presented using a configurable prompt character or glyph. Additionally, literal characters will be displayed when appropriate and are not required to be entered by the user.

1

A MaskedTextBox with the regex defined above, with no user input

When "5" is entered three times, the control fills in the three required regex elements and moves the caret over the dash, since it's a literal character and is required.

2

A MaskedTextBox with the regex defined above, with "555" typed as input

When "(70" is entered, then the left parenthesis indicates that the first entry in the regex alternation must be taken. Therefore, the proceeding "70" are entered in the area code. Additionally, two new literal characters are added, the ")" followed by a space, since they are required for that branch of the alternation.

3

A MaskedTextBox with the regex defined above, with "(70" typed as input

Finally, when "1-70" is entered, then the "1" would initially be associated with one of the required regex elements outside the alternation. But, when the "1" is followed by a "-" then it must take the second alternation branch, thus allowing "70" to be entered as the area code.

4

A MaskedTextBox with the regex defined above, with "1-70" typed as input

Prompt character/glyph

The prompt indicator can be any printable character, a custom Geometry (as seen above), or can be excluded all together. Additionally, the brush used for the prompt indicator can be defined separately from the foreground brush for the text. This allows the prompt indicator to have a subtle appearance, so it does not distract from the entered text.

Literal completion

By default, any literal characters will automatically be inserted when required. This saves the user from having to needlessly type common characters. It is also possible to require that the literal characters be entered manually. Therefore, the user must type every character in the regular expression into the MaskedTextBox.

Use with parts editor

The MaskedTextBox will be leveraged by the parts-based editors to help restrict and validate user input. So that things like the year part of DateTime parts-editor, only allows digits. Additional hooks will be available to verify that the "digits" actually equate to a valid year. This hooks will be available for general use, so that restricting and validating input will be a snap.

Tags: wpf, editors
Filed under: Actipro, In development, WPF
Submit to DotNetKicks...
Permalink | Comments (4)

Related posts

Actipro SyntaxEditor for WPF and Editors for WPF are released SyntaxEditor for WPF with a custom theme loaded Yesterday evening we published WP...Sneak Peek: Docking for WPFAs mentioned in a previous blog post, we're putting a lot of development time into a new product nam...Editors / PropertyGrid interop features coming in WPF Studio v5.0We are working hard to get WPF Studio 5.0 released, which includes our new Editors for WPF product. ...

Comments

January 21, 2009 at 20:01  

Christopher Hujanen

This is just what I am looking for.  Any rough idea of when it will be available for current customers?

Christopher Hujanen

January 22, 2009 at 03:06  

Hi Christopher,

We currently are finishing up some of the fundamentals of the framework for the control.  Then we will be working on specific implementations using the framework, such as a DateTimePicker, etc.  The framework is working out to be very nice and will allow you to create your own flexible implementations as well.

Keep an eye on the blog since we'll continue updating it with information as we get closer to release.

Bill Henning (Actipro)

January 23, 2009 at 03:13  

David mullin

I'll have to admit that, while Regular Expression syntax allows for much greater flexibility, it is also less accessible.

Any chance that you will also support the syntax of the WinForm MaskedEdit control as well?

David mullin

January 25, 2009 at 04:37  

Hi David,

Thanks for the suggestion. We will try to include that in the initial release, but it might have to wait for a follow up release.

We could do a direct conversion from the Winform syntax to our regex format, but there are some incompatibilities (specifically dealing with optional values). We would prefer to have our MaskedTextBox work like the WinForms MaskedTextBox, when using the same syntax.

Tom Goff (Actipro)

Comments are closed
Copyright © 1999-2012 Actipro Software LLC. All rights reserved.
Home Actipro Software | Products | Download | Contact Us