|
-
Nov 13th, 2003, 01:51 PM
#1
Thread Starter
Hyperactive Member
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.
-
Nov 13th, 2003, 06:02 PM
#2
Frenzied Member
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
-
Nov 14th, 2003, 12:30 AM
#3
Lively Member
validating, oh. I thought u ment formatting. Well, just do the traditional strategies.
VB Code:
Private Function VP(PhoneNo As String)
If Instr(PhoneNo, "-") > 1 Then
Return False
End If
If InStr(PhoneNo, "(") > 1 Then
Return False
End If
If Instr(PhoneNo, ")") > 1 Then
Return False
End If
' I know there are more limitations, but I don't have time to code all of it ;)
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."
-
Nov 14th, 2003, 01:12 AM
#4
PowerPoster
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.
-
Nov 14th, 2003, 01:30 AM
#5
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|