• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 333
  • Last Modified:

Mask Edit

Hi
  How could I use the mask edit to have the following input format.

  + or - 999.999999

ex          +156.894677
              -34.222

Any help is greatly appreciated.

Thanx

Dylan
0
b3cf
Asked:
b3cf
  • 5
  • 3
  • 2
  • +2
1 Solution
 
Arthur_WoodCommented:
I don't think that the Masked Edit Control has that level of flexibility.  However, you can write code in the KeyPress Event of a standard text box that could accomplish the same thing (that is, only allow a "+" or "-" as the first entry, and then only allow digits or a decimal point (only one) after the first KeyStroke.

0
 
Dave_GreeneCommented:
Put this in the format property

+#,###,###.########;-#,###,###.########
0
 
Dave_GreeneCommented:
This has the format of 3.6 as you wanted

+###.######;-###.######
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
b3cfAuthor Commented:
Hi Dave
  It didnt work, I need the mask.
0
 
b3cfAuthor Commented:
Hi Dave
  It didnt work, I need the mask.
0
 
b3cfAuthor Commented:
Hi Dave
  It didnt work, I need the mask.
0
 
Dave_GreeneCommented:
Ok, set your med box up like so

Format = +###.######;-###.######
Maxlength = 11
Mask = &###.######

should work.
0
 
sanjeevjain1973Commented:
Dave Greene

After Setting
Mask = &###.######

Thne you can time any charecter like a,b,c,......


Sanjeev
0
 
appariCommented:
set mask property to -999.999999
0
 
appariCommented:
ignore my previous posting

use mask as 9###.######

but this accepts digit value at the 1 st digit place where mask is 9. need to write code to suppress that in keypress if first digit is other than +/- then make keyascii=0

0
 
b3cfAuthor Commented:
Thanx Dave. Thanx everybody else who contributed.

Dylan
0
 
b3cfAuthor Commented:
Thanx Dave. Thanx everybody else who contributed.

Dylan
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 5
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now