|
-
Sep 21st, 2005, 02:17 AM
#1
Thread Starter
New Member
TextBox UserControl Problem
i am creating an UserControl in VB.net in which i have a textbox which contain properties like AllowOnlyNumeric,AllowOnlyCharacher etc so that i dont's have to code for these validations again n again plz give me some code to do that ASAP.
I am doing something like this
VB Code:
Private Sub TextBox1_KeyUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
If varOnlyNumber = True Then
'If Char.IsLetter(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
'If IsNumeric(e.KeyValue) Then e.KeyData.Clear()
End If
If VarOnlyString = True Then
If Char.IsDigit(CChar(TextBox1.Text)) = True Then TextBox1.Text = ""
End If
End Sub
Last edited by Hack; Sep 24th, 2005 at 05:26 PM.
-
Sep 22nd, 2005, 04:12 PM
#2
Re: TextBox UserControl Problem
This might beling in the .NET forums.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Sep 24th, 2005, 12:51 PM
#3
Re: TextBox UserControl Problem
Have you tried searching the VB.NET forum or CodeBank? There are several examples for a numbers only textbox, etc.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|