String.Format --- Listbox formatting issues


New member
Feb 22, 2005
Programming Experience
I know and have tested (to double-check) that the following code works in a windows application form:

Dim strFmt As String = "{0,20}{1,-20}{2,-20}{3,-20}{4,-20}"
ListBox1.Items.Add(String.Format(strFmt, "COMPANY", "LOCATION", "DNS EXPIRY", "ISP EXPIRY", "CAREPACK EXPIRY"))

All of the strings are evenly spread out in the listbox..

For some reason unknown to me, this same code does not have the same effect in a web project. All the strings are jumbled together. I've made sure that the font is Courier yet it does nothing. Does anyone know why or have a possible fix?

Latest posts

Top Bottom