Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
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!
Posted
Updated 24-Apr-12 23:13pm
v2
Comments
Sergey Alexandrovich Kryukov 24-Apr-12 11:32am    
How about some code sample? How do you think we can help you otherwise?
--SA
[no name] 24-Apr-12 19:46pm    
Here is a pastebin to my comment, it is too large http://pastebin.com/9BMYFeSZ

1 solution

you used the timer in a function block
use it as property or field
C#
timer.Stop();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900