Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Mask Edit

Posted on 2001-08-22
12
Medium Priority
?
330 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
  • 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 200 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

886 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