停止计时后在表单上停止图片. [英] To Stop picture on form after some timer.

查看:101
本文介绍了停止计时后在表单上停止图片.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void timer1_Tick(object sender, EventArgs e)
{
    x = x + 5;
    if (x > 300)
        x = 0;
    GrpboxSearchStudent.Location = new Point(x, x);
    //timer1.Stop();
}




进行一些移动后如何停止groupbox.
谁能帮助我




How can i stop groupbox after some move.
Can anyone help me

推荐答案

timer1.Stop()是正确的.它停止计时器,因此阻止进一步的事件处理程序执行和窗口移动.

您可以创建另一个对事件处理程序调用进行计数的变量.运行足够的时间后,停止计时器.
timer1.Stop() is correct. It stops the timer and therefore prevents further event handler execution and window movement.

You could create another variable that counts the event handler calls. After enough runs, stop the timer.


这篇关于停止计时后在表单上停止图片.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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