我有这个代码
private void picTop_MouseEnter(object sender, EventArgs e)
{
if (timer1.Tick == 10)
{
picBottom.Visible = true;
picTop.Visible = false;
timer1.Stop();
}
else
{
MessageBox.Show("ERROR You cannot view this section at this time.\nPlease try again later.");
}
}
private void picBottom_MouseEnter(object sender, EventArgs e)
{
picBottom.Visible = false;
picTop.Visible = true;
timer1.Start();
}
我的 timerinterval 设置为 1000 毫秒(所以 1 秒)我只希望用户在 10 秒后再次进入顶部面板。一些帮助将不胜感激。
我得到的当前错误:timer1.Tick 带有红色下划线,错误=“事件'System.Windows.Forms.Timer.Tick'只能出现在+=或-=的左侧