abrupt123 2015-11-04 04:35 采纳率: 42.9%
浏览 3928

timer1_Tick事件不执行

private void Form2_Load(object sender, EventArgs e)
{

        this.timer1.Start();
        this.timer1.Enabled = true;
        this.timer2.Enabled = true;
        this.Opacity = 0.5;

    }

    private void timer1_Tick(object sender, EventArgs e)
    {
        if (0<this.Opacity  && this.Opacity<1)
            this.Opacity = this.Opacity +0.01;
        else if (this.Opacity==1)
        {
           //this.Close();
            Form3 fc = new Form3();

            fc.Show();
            //this.Close();


        }
    }

执行完form1窗口的程序后打开form2窗口,form2窗口的load中的代码会执行,但timer控件没被激活,在timer-click事件设置断点不会执行,如果单独运行form2,imer控件会正常运行,请指教,谢谢

  • 写回答

1条回答

  • bdmh 移动开发领域优质创作者 2015-11-04 05:07
    关注

    你先看看设计器中有没有绑定tick事件

    评论

报告相同问题?

悬赏问题

  • ¥15 求chat4.0解答一道线性规划题,用lingo编程运行,第一问要求写出数学模型和lingo语言编程模型,第二问第三问解答就行,我的ddl要到了谁来求了
  • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果