tags:

views:

981

answers:

1

Hi

I have Multi Line TextBox (C# 2.0). I want to display some data as follows.

"Contact Person    : "  + string1 + Environment.NewLine
"Sales Man         : "  + string2 + Environment.NewLine
"Credit Limit      : "  + string3 + Environment.NewLine
"Due days          : "  + string4 + Environment.NewLine

But this code displaying as

Contact Person    :   Person1
Sales Man        :   salesman1
Credit Limit :  50000.00 
Due days       : 20

My problem is I can't align the text. My expected out put,

Contact Person    : Person1
Sales Man         : salesman1
Credit Limit      : 50000.00 
Due days          : 20

How can I achieve this?

+3  A: 

You need to change the font used by the textbox to a monospaced (non-proportional) font, like Courier.

Scott Dorman
+1 This is what you need to do. I would probably use String.Format also, but thats just personal preference.
SwDevMan81
I Checked with String.Format function. It also not working well. There is no other facility to do this ????
Anoop