从文本框到列表框. [英] from textboxes to listbox.

查看:89
本文介绍了从文本框到列表框.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题.

您有2个文本框,一个列表框和一个按钮.
您必须在每个文本框中输入一个数字,然后单击按钮时,数字应位于文本框中并按如下顺序进行排列...

您在第一个文本框上输入数字1,然后在另一个文本框上输入数字4,该列表框应分别包含1 2 3 4,请帮助!

I have a question.

You have 2 textboxes, one listbox and one button.
You have to put one number in each of the textboxes then when you click the button the numbers are supposed to be in the textbox and be arranged as follows...

You put number 1 on the first text box then number 4 on the other textbox, the listbox should contain, 1 2 3 4 respectively, help please!

推荐答案

尝试一下一:

Try this one:

int firstNumber = Convert.ToInt32(TextBox1.Text);
int secondNumber = Convert.ToInt32(TextBox2.Text);

for(int i = firstnumber ; i < secondNumber; i++)
{
   ListBox1.Items.Add(i);
}



问候,
爱德华



Regards,
Eduard


这篇关于从文本框到列表框.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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