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?
Printable View
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?
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
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
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
it keeps showing this vertical line for every entery!? :confused:
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?
And if you are concered about using a string as "069B" thenVB Code:
Dim c as Char=ChrW(&H69B)And if you want its .NET way thenVB Code:
Dim c as Char=ChrW(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))VB Code:
Dim c As Char = Convert.ToChar(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))
That's it.
wow, thanks