Masked Editbox 
Author Message
 Masked Editbox

I have a need for a textbox type control where the user can enter numbers
only
( ranging from 1 to 9999 ) and the Masked Editbox seemed to be the way to
go.
However, two problems;

1. If I set the Mask property to 9999 as Help suggests and the user enters
only 3 digits (for example "200"), when I try to recover the text value into
an integer, I get a type mismatch message. The text property seems  to
contain the value "200_".

2. I would also like to Left Align the characters, but I cant find any way
to do this.

If anyone can help out with this, it would be greatly appreciated.
BTW, thanks everyone for the great help in regards to the timer control
problem the other week. The API Sleep function works great!

Thomas Lundberg



Mon, 26 Mar 2001 03:00:00 GMT  
 Masked Editbox
hi

put this code in the keypress event of a regular text box

If KeyAscii < 48 Or KeyAscii > 57 And KeyAscii <> 8 Then KeyAscii = 0

bye


Quote:

>I have a need for a textbox type control where the user can enter numbers
>only
>( ranging from 1 to 9999 ) and the Masked Editbox seemed to be the way to
>go.
>However, two problems;

>1. If I set the Mask property to 9999 as Help suggests and the user enters
>only 3 digits (for example "200"), when I try to recover the text value
into
>an integer, I get a type mismatch message. The text property seems  to
>contain the value "200_".

>2. I would also like to Left Align the characters, but I cant find any way
>to do this.

>If anyone can help out with this, it would be greatly appreciated.
>BTW, thanks everyone for the great help in regards to the timer control
>problem the other week. The API Sleep function works great!

>Thomas Lundberg



Mon, 26 Mar 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MASKED EDITBOX VB50. CHANGING BACKCOLOR FOR ENABLED=FALSE

2. Mask EditBox problem.

3. Masked editbox

4. Masked Editbox

5. Masked Editbox

6. Masked EditBox problem

7. Problems with masked editboxes, data bound labels, date fields and Access 95.

8. MASKED EDITBOX VB5.0. CHANGING BACKCOLOR WHEN ENABLED=FALSE

9. Problems with masked editboxes, data bound labels, date fields and Access 95.

10. How do I populate data from a database into a Masked Editbox?

11. Data Entry Masks Without Masked Edit Box

12. VB6 Mask Doesn't Always Mask

 

 
Powered by phpBB® Forum Software