Skip to main content

[Migrated content. Thread originally posted on 04 November 2011]

We are new to Visual Cobol and have toyed around with building an application in Winforms as well as WPF in order to figure out which to embrace. We have leaned towards WPF but we are running into situations where Winforms has options for a Masked Textbox and WPF does not. All of the internet searches reveal that WPF is much more difficult in handling these situations. An oversighte on Microsofts part? Our simple application has a textbox defined, the maximum is 9 positions. All we want to do is ensure that we have either nothing in the textbox, including no spaces, or we have 9 numerics only, no alpha or spaces allowed. How would you handle this in WPF? How can we handle a simple phone number so that the textbox has "( ) - " to start and the masking will only allow either nothing or a format of "(123)456-7890"?

[Migrated content. Thread originally posted on 04 November 2011]

We are new to Visual Cobol and have toyed around with building an application in Winforms as well as WPF in order to figure out which to embrace. We have leaned towards WPF but we are running into situations where Winforms has options for a Masked Textbox and WPF does not. All of the internet searches reveal that WPF is much more difficult in handling these situations. An oversighte on Microsofts part? Our simple application has a textbox defined, the maximum is 9 positions. All we want to do is ensure that we have either nothing in the textbox, including no spaces, or we have 9 numerics only, no alpha or spaces allowed. How would you handle this in WPF? How can we handle a simple phone number so that the textbox has "( ) - " to start and the masking will only allow either nothing or a format of "(123)456-7890"?
Good question. I was doing battle with that problem too, working with Eclipse under Unix.

[Migrated content. Thread originally posted on 04 November 2011]

We are new to Visual Cobol and have toyed around with building an application in Winforms as well as WPF in order to figure out which to embrace. We have leaned towards WPF but we are running into situations where Winforms has options for a Masked Textbox and WPF does not. All of the internet searches reveal that WPF is much more difficult in handling these situations. An oversighte on Microsofts part? Our simple application has a textbox defined, the maximum is 9 positions. All we want to do is ensure that we have either nothing in the textbox, including no spaces, or we have 9 numerics only, no alpha or spaces allowed. How would you handle this in WPF? How can we handle a simple phone number so that the textbox has "( ) - " to start and the masking will only allow either nothing or a format of "(123)456-7890"?
There are several 3rd party tools out there that can be downloaded that support these types of controls in WPF.

One that looks promising can be found here:

Extended WPF Toolkit

There is also a method where you can host Windows Forms controls on a WPF form.

See this article:

Thanks.