首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

MessageBox.Show解决方案

2012-03-24 
MessageBox.ShowC# codepublic partial class Form1 : Form{int i 0public Form1(){InitializeComponen

MessageBox.Show

C# code
    public partial class Form1 : Form    {        int i = 0;        public Form1()        {            InitializeComponent();        }        private void Form1_Load(object sender, EventArgs e)        {            timer1.Enabled = true;            timer1.Interval = 1000;        }        private void timer1_Tick(object sender, EventArgs e)        {            i++;            MessageBox.Show(i.ToString());            if (i >= 5)                timer1.Enabled = false;//timer停止        }    }

为什么它就停不掉?MessageBox.Show还有这功能?

[解决办法]

你自己看看你的代码,真是服了你了!

[解决办法]
探讨
C# code

private void timer1_Tick(object sender, EventArgs e)
{
i++;
MessageBox.Show(i.ToString()); //应该是i+1,然后打出来,然后再加1,然后再打,直到i=5,不是?
if (i >= 5) ……

热点排行