mpdillon
Member
I am adding items to a listbox. I would like the items to be aligned vertically in columns. To accomplish this in VB6, I would use a Courier New font and pad the items to achieve the proper spacing to give the visual affect of columnar data. I have tried the same thing in vb.net. However, the .Add method removes the padding.
I start with:
strLine = strDept.PadRight(30, " ") + "- " + strPos
I can view the item in debug and I see strline = “Dept Name padded to 30 spaces – Position”
However after lstDept.add(strline), the list box on the form displays:
“Dept Name – Position”.
The padding which was applied to the Dept Name is gone, except for the single space in front of the dash.
I am doing this on a Web Form but I am assuming the behavior is a VB behavior. That is why I posted here.
Can anyone offer an explanation.
Thanks
I start with:
strLine = strDept.PadRight(30, " ") + "- " + strPos
I can view the item in debug and I see strline = “Dept Name padded to 30 spaces – Position”
However after lstDept.add(strline), the list box on the form displays:
“Dept Name – Position”.
The padding which was applied to the Dept Name is gone, except for the single space in front of the dash.
I am doing this on a Web Form but I am assuming the behavior is a VB behavior. That is why I posted here.
Can anyone offer an explanation.
Thanks