Hi,
could someone help me work out how to write this format expressions it goes something like

displayBox.AppendText(string.Format("{0,-20}{1,0}\n", add11, add21));
displayBox.AppendText(string.Format("{0,-20}{1,0}\n", add12, add22));
displayBox.AppendText(string.Format("{0,-20}{1,0}\n", add13, add23));
displayBox.AppendText(string.Format("{0,-20}{1,0}\n", add14, add24));

the problem im having is that when add14 is empty add24 doesn't align properly with add22, add21, and add23
could someones please tell me what im missing? assume that addxx values are all less than 20 chars in length, but and addxx can be empty.
Any help would be appreciated.
Thanks

Are you using a mono-spaced font?

Yea i believe it is, it is just the standard one used when you create a C# WPF project with a textbox

When I create a new project it defaults to Seguo UI, which is not mono spaced. Change the font to Seguo UI Mono and see if that helps you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.