Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Development Tools
 Other Development Tools
 Getting Textbox to read valid barcode in VB.Net
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

OfMartin
Starting Member

11 Posts

Posted - 04/15/2005 :  12:58:09  Show Profile  Reply with Quote
I'm creating a Visual Basic form that reads barcode input by the user. I need my textbox to read only alpha-numeric characters that are 10 characters long. Here's what I have so far...This code actually checks to see if the input is "numeric" not "alpha-numeric" like the comments say. Guys, please if you could help me, I'll forever be thankful.

Dim x As Int16
Dim strNew As String = ""

'Review all charactes in the txtBarcode text box to ensure that they are alpha-numeric digits
'Loop through all characters and pass alpha-numeric digits to a new string
For x = 0 To Len(txtBarcode.Text) - 1
If InStr("0123456789", txtBarcode.Text.Substring(x, 1)) > 0 Then
' Char is alpha-numeric
strNew += txtBarcode.Text.Substring(x, 1)
Else ' Char is not alpha-numeric
Beep() ' Warn user
lblHelp.Text = "Character is not alpha-numeric"
End If

OfMartin890@yahoo.com

OfMartin
Starting Member

11 Posts

Posted - 04/15/2005 :  19:38:39  Show Profile  Reply with Quote
wow, guys. I'm sorry again with this question. The reason why I asked you this question might be because I've been lacking some sleep. All textboxes by default accept alpha-numeric characters so there is no code to write to solve my question, which you guys probably figured in a blink of an eye and didn't figure it was worth bothering to type it out. For everyone who wasted their time with reading my question, I'm really apologize for the inconvenience. This probably won't be the last time I post something idiotic on this message board. Please bear some patience with me, I'm just sleep-deprived.

OfMartin890@yahoo.com
Go to Top of Page

carolinenew
Starting Member

4 Posts

Posted - 05/26/2014 :  22:58:44  Show Profile  Reply with Quote
it's ok, and i have no experience in VB.NET, but in C#.NET. anyway you can read this .NET tutorial to read barcode, hope it helps you.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000