-
Mar 31st, 2015, 04:27 AM
#1
Thread Starter
New Member
[RESOLVED] Inserting special characters at the beginning & end of user input
Hi,
I'm creating a simple barcode generator in Visual Basic
Currently a barcode has to be typed in by a user like: *DIS17*, *DIS16*, *DIS17* etc to generate it correctly.
My issue is that the client does not want to have to type the *s in, at risk of confusion.
Is there any possible way to do this? I've been searching for hours and found nothing suitable yet!
I'm a student doing this at a work placement and I would really appreciate the help!
Thanks,
Hayley
Code I used:
Private Sub btnGenerate_Click(sender As Object, e As EventArgs) Handles btnGenerate.Click
'set txtBarcode to have the same data that was entered into the txtRackID textbox.
'txtRackID is set to the font 'Free 3 of 9', which converts the text to the matching barcode.
txtBarcode.Text = txtRackID.Text
End Sub
Attachment 125201Attachment 125203
-
Mar 31st, 2015, 07:43 AM
#2
Re: Inserting special characters at the beginning & end of user input
Look at this.
Code:
Dim output As String = "*" & txtBarcode.Text & "*"
Messagebox.Show(output)
is that that what you wanted?
-
Mar 31st, 2015, 07:48 AM
#3
Thread Starter
New Member
Re: Inserting special characters at the beginning & end of user input
Yes, it is. Thanks!
I tried that but completely forgot the & signs.
Thanks again.
-
Mar 31st, 2015, 07:52 AM
#4
Re: [RESOLVED] Inserting special characters at the beginning & end of user input
It's called string concatenation. You might want to Google the term in order to gain better understanding.
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
|