无法让计时器停止计时-使用了timer.stop [英] Can't get a timer to stop ticking - used timer.stop

查看:96
本文介绍了无法让计时器停止计时-使用了timer.stop的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关实际代码,请转到此pastebin:http://pastebin.com/9BMYFeSZ

好的,这是我的应用程序的另一个功能,它记录了4个按键来创建快捷键组合.

您单击一个按钮启动计时器或录制",计时器使用以下代码等待您的输入:http://www.myanmaritresource.info/t138-a...rogramming

完成后,它会告诉您您输入了某个键并将其附加到文本框和变量.

但是,我无法使4的计时器1停止计时,我已经将其处置,禁用,停止了,似乎没有任何作用.链接中的实际代码使用goto循环来按下某个键后,我想我不能中断它.

我已经告诉它退出子,呼叫其他子,我不确定.

该代码可以正常工作,但是,当您单击#2记录按钮,然后按键盘上的一个键时,您需要执行两次,因为第一次更改了记录1的值,而第二次更改了应做的操作,所以现在您有了重复项,例如:

如果您想将1 + 2 + 3 + 4作为击键,那么如果将1作为第一个值,那很好,但是如果您想将2作为第二个值,就这样.

? =未定义值

步骤1(完成录音1):1 +?+?+?
步骤2(记录数字2,但值更改为1):2 +?+?+?
步骤3(再次按键以更改值2):2 + 2 +?+?

我真的希望你能理解.

谢谢!

For the actual code, go to this pastebin: http://pastebin.com/9BMYFeSZ

Ok, this is another feature to my application that records 4 keystrokes to create a shortcut combination.

You click a button that starts a timer or the "recording", the timer waits for your input using this code: http://www.myanmaritresource.info/t138-a...rogramming

When done, it tells you that you entered a certain key and appends it to a textbox and variable.

However, I cannot get timer 1 of 4 to stop ticking, I''ve disposed of it, disabled it, stopped it, nothing seems to work. The actual code from the link uses a goto loop to after a key has been pressed, I think I can''t break out if it.

I''ve told it to exit sub, call other subs, I''m just not sure.

THE CODE DOES WORK, however when you click record button # 2, and then press a key on your keyboard, you need to do it twice, as the first time changes the value of record 1 and the second time does what it was supposed to, so now you have duplicates, e.g:

If you wanted 1+2+3+4 as the key strokes, if you put 1 in for the first value, that is fine, but if you want 2 for the second it goes like this.

? = undefined value

Step 1 (finished recording 1): 1+?+?+?
Step 2 (record number 2, but changes value of 1): 2+?+?+?
Step 3 (press the key again to change value 2): 2+2+?+?

I really hope you understand.

Thanks!

推荐答案

您在功能块中使用了计时器
用作属性或字段
you used the timer in a function block
use it as property or field
timer.Stop();


这篇关于无法让计时器停止计时-使用了timer.stop的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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