|
-
Dec 12th, 2003, 01:47 PM
#1
Thread Starter
Addicted Member
unicode?
i know for example that "069B" represents the char that i want in unicode, now how can i show that char for example in a label?
-
Dec 13th, 2003, 02:59 AM
#2
Thread Starter
Addicted Member
anybody with any ideas??????
i think it should look something like this ...
Code:
Dim a() As Byte = {"069B"} ' this is where i'm stuck
Dim chars() As Char
Dim enc As New System.Text.UnicodeEncoding()
chars = enc.GetChars(a)
Label1.Text = chars(0)
but how to we asign the value to the byte, its a hex value
thanks
-
Dec 13th, 2003, 04:02 AM
#3
Thread Starter
Addicted Member
what i really want to to is just enumerate through unicode ( availibe ranges ) charecters and show them in a label or something
it shouldn't be that i hard ,i just cant figure it out myself, any help is appreciated
-
Dec 13th, 2003, 06:34 AM
#4
to convert it from hex to unicode , you can use ALT & x in a richtextbox , make a temporary richtextbox , add it to your controls , use sendkeys, then remove it from your controls. eg:
VB Code:
Dim strHex As String = "069B"
Dim rtbox As New RichTextBox()
rtbox.Height = 1
rtbox.Width = 1
Controls.Add(rtbox)
rtbox.Text = strHex
rtbox.SelectAll()
rtbox.Focus()
SendKeys.SendWait("%(x)")
MessageBox.Show(rtbox.Text)
Controls.Remove(rtbox)
rtbox = Nothing
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Dec 13th, 2003, 06:44 AM
#5
Thread Starter
Addicted Member
it keeps showing this vertical line for every entery!?
shouldnt there be another easier way to do it? is there any base type that can hold hex values, so we can just pass it to the encoding.getchars method?
-
Dec 13th, 2003, 07:50 AM
#6
Frenzied Member
VB Code:
Dim c as Char=ChrW(&H69B)
And if you are concered about using a string as "069B" then
VB Code:
Dim c as Char=ChrW(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))
And if you want its .NET way then
VB Code:
Dim c As Char = Convert.ToChar(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))
That's it.
Last edited by Lunatic3; Dec 13th, 2003 at 08:00 AM.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Dec 13th, 2003, 09:52 AM
#7
Thread Starter
Addicted Member
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
|