有没有办法显示组合框的百分比值,如20% [英] Is there a way to display the combobox with percentage values like 20%
本文介绍了有没有办法显示组合框的百分比值,如20%的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
有没有办法加载组合框,其值为0%,20%,40%..在我的情况下,我正在加载来自Datatable的值。这是我的代码
Hi All,
Is there a way to load the combobox with values like 0%,20% ,40%..In my case i am loading the values from a Datatable. Here is my code
Private m_dtPercentofSales As New DataTable
m_dtEstDelayedDeliveryPercentofSales = GetPercentofSales()
For Each dr As DataRow In m_dtPercentofSales.Rows
Me.cmbPercentofSales.Items.Add(dr("PercentofSales"))
Next
请帮助。谢谢。
Please help.Thanks.
推荐答案
组合只能显示一个字符串,除非你自己画组合。
所以,如果它是你要添加的字符串,为什么不这样做:
The combo can only ever show a string, unless of course, you paint the combo yourself.
So, if it''s a string you''re adding, why not just do this:
cmdPectentageofSales.Items.Add(dr("PercentageofSales").ToString() + "%");
真的,这有多难?
Really, how hard was that?
这篇关于有没有办法显示组合框的百分比值,如20%的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文