Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms Label Text property not displaying \t tab character

Tags:

c#

winforms

This should be very simple.

I have a Label control on my Form and I am trying to put a tab character between text

Label.Text = "Is there a\ttab";

The output is "Is there atab";

What am I doing wrong?

like image 738
Jon Avatar asked Jan 28 '10 13:01

Jon


1 Answers

Nothing, windows forms labels are very limited in functionality and don't support the \t character.

A (slightly awkward) alternative might be:

label1.Text = "test\ting\t123".Replace("\t","    ");
like image 91
Ash Avatar answered Sep 20 '22 09:09

Ash