|
-
Jul 8th, 2010, 09:29 AM
#1
Thread Starter
Hyperactive Member
Only using the first characters entered in textbox..
Hey,
I'm working on a query where I only want to use the 8 first characters entered in to the textbox. Is there some attribute to textbox that allows me to do this?
Thanks for your time.
-
Jul 8th, 2010, 09:35 AM
#2
Addicted Member
Re: Only using the first characters entered in textbox..
you want to limit textbox characters to 8 max, or you need to parse first 8 characters from it?
explain a bit more please
-
Jul 8th, 2010, 09:48 AM
#3
Re: Only using the first characters entered in textbox..
If you don't want to limit the textbox content size you can simply use substring
vb.net Code:
textbox1.text.substring(0,8)
will return the first 8 characters of your textbox. Make sure that your textbox contains at least 8 characters before calling the substring if you don't want an exception to be thrown.
Alex
.NET developer
"No. Not even in the face of Armageddon. Never compromise." (Walter Kovacs/Rorschach)
Things to consider before posting.
Don't forget to rate the posts if they helped and mark thread as resolved when they are.
.Net Regex Syntax (Scripting) | .Net Regex Language Element | .Net Regex Class | DateTime format | Framework 4.0: what's new
My fresh new blog : writingthecode, even if I don't post much.
System: Intel i7 920, Kingston SSDNow V100 64gig, HDD WD Caviar Black 1TB, External WD "My Book" 500GB, XFX Radeon 4890 XT 1GB, 12 GBs Tri-Channel RAM, 1x27" and 1x23" LCDs, Windows 10 x64, ]VS2015, Framework 3.5 and 4.0 
-
Jul 8th, 2010, 09:49 AM
#4
Thread Starter
Hyperactive Member
Re: Only using the first characters entered in textbox..
I need the user to be able to type into the textbox, for instance: "3334445554422",
but I only want to use "33344455". I can't limit the textbox, because it's necessary for them to type in the whole number. I wish the was like a textbox1.text(limit=8) function..
Thank you for replying!
-
Jul 8th, 2010, 09:49 AM
#5
Thread Starter
Hyperactive Member
Re: Only using the first characters entered in textbox..
Ah, okay! Thanks, stlaural!
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
|