Results 1 to 5 of 5

Thread: Substitute for MaskEdit in VB.NET

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    320

    Substitute for MaskEdit in VB.NET

    I want to validate customer input for ph# for eg in format (901) 348 3455. In VB6 we could use a
    maskEdit control to format phone nos etc. How do we do that in
    .NET. please suggest.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Maybe buliding your own user control that does validation for different formats you pass to it.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3
    Lively Member
    Join Date
    Aug 2003
    Location
    When?!?!
    Posts
    108
    validating, oh. I thought u ment formatting. Well, just do the traditional strategies.

    VB Code:
    1. Private Function VP(PhoneNo As String)
    2.      If Instr(PhoneNo, "-") > 1 Then
    3.           Return False
    4.      End If
    5.  
    6.      If InStr(PhoneNo, "(") > 1 Then
    7.           Return False
    8.      End If
    9.  
    10.      If Instr(PhoneNo, ")") > 1 Then
    11.           Return False
    12.      End If
    13.      
    14. ' I know there are more limitations, but I don't have time to code all of it ;)
    15.  
    16. End Sub
    The traditional way....
    DannyJoumaa
    Advanced VB6 Programmer
    Intermediate-Advanced VB .NET Programmer
    Intermediate C# Programmer
    Intermediate Win32 Developer
    Beginner Mac OS X Developer
    Contact: [email protected]

    Favorite Sayings:
    "Every time you open your mouth, you prove your an idiot."
    "God is a programmer. Satan is a bug. Life is debugging."

  4. #4
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I haven't seen a 'good' .Net way yet, although I would be very suprised if they were not out there. You can still use the old masked input though. You just need to reference it from the COM tab. It is something like MSMASK.OCX .... or not...don't remember that well.

  5. #5
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I once used that masked input thing. I cant remember what, but I had problems with that, so I abandoned using it.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

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