Results 1 to 3 of 3

Thread: Mask edit box and numbers

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    14

    Post

    How can I know if the text of a mask edit box has no letters in it? (I just want numbers) A mask doesn't work because I want numbers with 2 decimals and it's not a good thing to put a mask like 9999999.99 (if you know what I mean. The data entry is not practical, you can't type the . anywhere like in, say, Fox)
    Thanks!!

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523

    Post

    if MaskEdBox doesn't make any sense to you why won't you use TextBox????

    If it works for you here is the code to not allow letter:
    Code:
    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If Not IsNumeric(Chr(KeyAscii)) And Chr(KeyAscii) <> "." Then
            KeyAscii = 0
        End If
    End Sub
    Hope this will help

    ------------------
    Visual Basic Programmer (at least I want to be one)
    ------------------
    PolComSoft
    You will hear a lot about it.


  3. #3
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    Post

    MaskEdit1.Mask = "######.##"
    or however many.
    ie..# for numbers
    ? for alphaa

    A mask will not allow anything but what is maksked.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width