Question

In Visual Basic.net I managed to get this little arrow symbol in the TextBox some time ago, but lost it.

Is this font dependent? I used Consolas and Courier New. Do i need a RichTextBox or something else?

I tried chr(10) and chr(13), environment.newline and vbLf, vbCr and what else but I'm lost.

I just want to have that special character to be visible for "debug purposes". My system is UTF capable.

Était-ce utile?

La solution

The TextBox does not display unprintable characters, like most text editors can do.

You can, however, simply insert the symbol yourself, be replacing each newline character with and a newline character.

Example:

Dim f = New Form()
Dim txt = New TextBox() With { .MultiLine = True, .Dock = DockStyle.Fill}

Dim text = <text>This is just
                 some multine text
                 to be displayed</text>.Value

txt.Text = Regex.Replace(text, "(\n\r|\r|\n)", "↵$1")

f.Controls.Add(txt)
f.ShowDialog()

Result:

enter image description here

Autres conseils

This is a standard character, no fancy fonts required.

Here's all you could wish to know about it..

Encodings

HTML Entity (decimal)   &#8629;
HTML Entity (hex)   &#x21b5;
HTML Entity (named) &crarr;
How to type in Microsoft Windows    Alt +21B5
UTF-8 (hex) 0xE2 0x86 0xB5 (e286b5)
UTF-8 (binary)  11100010:10000110:10110101
UTF-16 (hex)    0x21B5 (21b5)
UTF-16 (decimal)    8,629
UTF-32 (hex)    0x000021B5 (21b5)
UTF-32 (decimal)    8,629
C/C++/Java source code  "\u21B5"
Python source code  u"\u21B5"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top