Klogg Posted October 23, 2003 Posted October 23, 2003 How do I display ASCII characters as the text property of a button? Quote Take a look at my programs. Go to my web site.
techmanbd Posted October 23, 2003 Posted October 23, 2003 me.button1.text = chr(ASCII CODE NUMBER) Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Klogg Posted October 23, 2003 Author Posted October 23, 2003 (edited) If I do that, it says, "Method System.Char.Chr not found." If I compile the program when it says that, an "a" with a tilde over it appears as the button text, but I told it to display the Greek letter pi. Edited October 23, 2003 by Klogg Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 23, 2003 *Experts* Posted October 23, 2003 Button1.Text = Convert.ToChar(code number) Quote
Klogg Posted October 23, 2003 Author Posted October 23, 2003 I tried that too, and it does the same thing. I also found out that if I put in a different code number, it displays a different character, but it's not the one it's supposed to be either. Why is it displaying this error message and showing the wrong characters? Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 23, 2003 *Experts* Posted October 23, 2003 That depends...what ASCII code are you attempting to display? Quote
Klogg Posted October 23, 2003 Author Posted October 23, 2003 Pi, but it does the same thing for every one that I try. Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 23, 2003 *Experts* Posted October 23, 2003 What happens when you try 97? Quote
Klogg Posted October 23, 2003 Author Posted October 23, 2003 The error message still appears, and the character in the button is "a." Quote Take a look at my programs. Go to my web site.
Klogg Posted October 23, 2003 Author Posted October 23, 2003 Looks like it shows the right characters until I get up to 128. Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 23, 2003 *Experts* Posted October 23, 2003 Many of the characters above 128 are not all the same in every font. Make sure you're looking at the ASCII table for the right font. I recommend the Character Map for that. Quote
Klogg Posted October 23, 2003 Author Posted October 23, 2003 What is the character map? Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 23, 2003 *Experts* Posted October 23, 2003 It comes with Windows. Start -> Run -> charmap.exe Quote
Klogg Posted October 23, 2003 Author Posted October 23, 2003 Ok, thanks. Quote Take a look at my programs. Go to my web site.
Klogg Posted October 24, 2003 Author Posted October 24, 2003 One more question. Is there either a way to find the ASCII value from the Character Map or a way to convert Unicode to text in VB? If I just copy and paste the pi symbol to my code, it changes it to "p" every time I close Visual Studio and open it again. Quote Take a look at my programs. Go to my web site.
*Experts* Volte Posted October 24, 2003 *Experts* Posted October 24, 2003 What do you mean by that? Can't you use Convert.ToChar? Quote
Klogg Posted October 24, 2003 Author Posted October 24, 2003 I'm assuming that the "U+03C0" that the character map gives me is Unicode, so how do I tell that to VB or find an ASCII value for it? If you can put that value in the Convert.ToChar statement, I can't figure out how. Quote Take a look at my programs. Go to my web site.
Klogg Posted October 27, 2003 Author Posted October 27, 2003 I found out that the "U+03C0" is the Unicode, or maybe just the number part of it. Could someone please tell me how to convert this to an ASCII value or how to tell VB to display it? Quote Take a look at my programs. Go to my web site.
Klogg Posted October 27, 2003 Author Posted October 27, 2003 Never mind. I figured it out. I have to convert the 03C0, which is hexidecimal, to decimal, and enter that in a Convert.ToChar statement. It works, but it still says, "Method System.Char.ToChar not found," in the Task List for some strange reason. Quote Take a look at my programs. Go to my web site.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.