Solved

Mask Edit

Posted on 2001-08-22
12
317 Views
Last Modified: 2008-02-20
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
Comment
Question by:b3cf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +2
12 Comments
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 6414866
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
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6414908
Put this in the format property

+#,###,###.########;-#,###,###.########
0
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6414911
This has the format of 3.6 as you wanted

+###.######;-###.######
0
Industry Leaders: 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!

 

Author Comment

by:b3cf
ID: 6414940
Hi Dave
  It didnt work, I need the mask.
0
 

Author Comment

by:b3cf
ID: 6414961
Hi Dave
  It didnt work, I need the mask.
0
 

Author Comment

by:b3cf
ID: 6414999
Hi Dave
  It didnt work, I need the mask.
0
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 50 total points
ID: 6415045
Ok, set your med box up like so

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

should work.
0
 
LVL 1

Expert Comment

by:sanjeevjain1973
ID: 6416014
Dave Greene

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

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


Sanjeev
0
 
LVL 39

Expert Comment

by:appari
ID: 6416234
set mask property to -999.999999
0
 
LVL 39

Expert Comment

by:appari
ID: 6416246
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
 

Author Comment

by:b3cf
ID: 6417361
Thanx Dave. Thanx everybody else who contributed.

Dylan
0
 

Author Comment

by:b3cf
ID: 6419045
Thanx Dave. Thanx everybody else who contributed.

Dylan
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question