关于用VS窗体编写一个99乘法表

nglwcm 2012-06-07 10:12:35
我的窗体有一个listBox 跟两个Button listBox是用来显示99乘法表的,Button1是执行 点击就输出99乘法表 Button2是退出,点击就退出 请问listBox Button1 Button2 代码分别怎么编写?求啊~ 小弟感激不尽啊!
...全文
661 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
anzhiqiang_touzi 2012-06-07
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 的回复:]
C# code

private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
for (int i = 1; i < 10; i++)
{
string s = ""……
[/Quote]
熙风 2012-06-07
  • 打赏
  • 举报
回复
private void button1_Click(object sender, EventArgs e)
{
listBox1.Items.Clear();
for (int i = 1; i < 10; i++)
{
string s = "";
for (int j =1; j <=i; j++)
{
s+= i + "*" + j + "=" + i * j+" ";

}
listBox1.Items.Add(s);
}
}

private void button2_Click(object sender, EventArgs e)
{
this.Close();
}
soul850522 2012-06-07
  • 打赏
  • 举报
回复
。。。。很基础的写循环啊,楼主最好能自己多考虑下
cnfixit 2012-06-07
  • 打赏
  • 举报
回复
listbox.items.add("1*1=1");
listbox.items.add("1*2=2 2*2=4");

这你总会写吧
E次奥 2012-06-07
  • 打赏
  • 举报
回复
写点实用的东西,不要乱搞!

111,126

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧