CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 1999
    Location
    France
    Posts
    29

    Mask without a mask

    I want to use a TextBox where only numbers and letters can be put.
    How can I do that?
    Or how can I use the mask edit box???

    Fzz


  2. #2
    Join Date
    Sep 1999
    Location
    Red Wing, MN USA
    Posts
    312

    Re: Mask without a mask

    If you don't want to use the Masked Edit Control, try something like:

    private Sub Text1_Keypress(KeyAscii as Integer)
    If InStr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 " & Chr(vbKeyBack), Chr(KeyAscii), vbTextCompare) = 0 then KeyAscii = 0
    End Sub





    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]
    Aaron Young
    Senior Programmer Analyst (Red Wing Software)
    Certified AllExperts Expert

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

Featured