ListBox在绑定数据时空格丢失,急!!!
我要实现一个多列的ListBox,已经开过贴
http://community.csdn.net/Expert/topic/3673/3673743.xml?temp=.7493097
代码:
while (dr.Read())
{
string strListItemText = dr["name"].ToString().PadRight(30-dr["name"].ToString().Length).ToString() + "|"+dr["sex"].ToString()+"|" + dr["education"].ToString();
string strListItemValue = dr["email"].ToString();
listBox_info.Items.Add(new ListItem( strListItemText,strListItemValue));
}
在调试的时候能够看到strListItemText中的有空格,不知道为什么在显示的时候空格都没有了,所以各列没有办法对齐,请各位高手指教!!谢谢!!!