列表框未以正确的格式显示值 [英] Listbox not showing values in proper format

查看:87
本文介绍了列表框未以正确的格式显示值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在将值绑定到列表框,但是stirng没有以正确的格式显示.


这样我的弦
abc 10
abcd 20
asdfas 30

我使用padding将第一个字符串的固定长度设置为30

Hi,

I am binding values to list box but stirng 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 pading

str1.PadRight(30) + str2.PadRight(2)


然后我也得到了这样的价值

abc 10
abcd 20
asdfas 30

请给我建议如何在字符串


then also I am getting values like that

abc 10
abcd 20
asdfas 30

Plese suggest how can I put same space between string

推荐答案

之间插入相同的空格如果要在x轴上的同一个位置下方插入另一个空格,然后首先计算第一个字符串的长度,并使用padding.padsding值由特定值派生-字符串的长度
例如

str1.PadRight(30-str1.length)

我希望它能起作用
IF you want to digit below the other in same potion along x-axis then first calulate length of first string and using padding.padsding value derive by certain value - length of string
eg

str1.PadRight(30-str1.length)

I hope it will work


这篇关于列表框未以正确的格式显示值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆