Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27186

VS 2010 Giving a certain number based on a certain character in a textbox.

$
0
0
Hi, this is my first post. And I am pretty much brand new to Visual Basic so go easy :)
I am creating a simple project for my electronics course in school that converts a character into binary that can be used on a micro-controller in a 7 segment display.
Basically, I am trying to put a letter in and get a number out.

This is converting a number to binary like so (this works):
Code:

ElseIf TextBox1.Text = "1" Then
            TextBox2.Text = "%00110000"

This is converting a character to binary like so (this doesn't work):
Code:

ElseIf TextBox1.Text = "a" Then
            TextBox2.Text = "%01110111"

This is probably stupidly basic, but I have searched around and I have found little on this. I want it not to convert it to the number, but to check if it is the certain character and display a certain number.

Thanks in advance :)

Viewing all articles
Browse latest Browse all 27186

Trending Articles