I am binding values to list box but string not showing in proper format.
ex my strings like
abc 10
abcd 20
asdfas 30
I made fixed length to first string that is 30 using padding
str1.PadRight(30) + str2.PadRight(2)
then also I am getting values like that
abc 10
abcd 20
asdfas 30
Please suggest how can I put same space between string
The Windows User Interface usually uses a variable-width font, so you can’t just pad with spaces to a given column to get the text to line up.
You will either need to set the ListBox to use a monospaced font (Courier or Lucida Console for example), use a ListView (or similar) that supports columns, or implement owner-drawn items so that you can control how the items are displayed, splitting up the text to drawing it in columns.