问题描述
我有两个文本框,一个有值递增,另一个给出增量的数量,增量值显示在列表框上
i想要当值插入列表框时每个值必须有ERT 带有它的信件。
i尝试跟随,但它影响了我的系列递增
decimal j = Convert.ToDecimal(textBoxlist.Text);
Int64 k = Convert.ToInt64(textBoxQuantity.Text);
if(textBoxlist.Text.Length> 15)
{
for(int i = 0; i< k ; i ++)
{
SerialListBox.Items.Add(ERT+ j + i + 1);
}
我想在每个列表框项目中添加ERT的前缀。
i have two text box one have value to increment and other one gives the amount to increment with and increment value is showen on listbox
i want when value is inserted to listbox each value must have "ERT" letters with it.
i tried following but it is effecting my incrementing of series
decimal j = Convert.ToDecimal(textBoxlist.Text);
Int64 k = Convert.ToInt64(textBoxQuantity.Text);
if (textBoxlist.Text.Length >15)
{
for (int i = 0; i < k; i++)
{
SerialListBox.Items.Add("ERT"+j + i + 1);
}
simply i want to add prefix of ERT to each list box item.
推荐答案
SerialListBox.Items.Add("ERT"+j + i + 1);
to
to
SerialListBox.Items.Add("ERT"+j + (i + 1));
如果我错过了你的问题,请通过解释告诉我它进一步。
If I have missed your problem completley please let me know by explaining it further.
这篇关于为列表框中的每个已添加项添加前缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!