I’m a tad new to C# so please bear with me!
I am writing a program to send code via RS232 to a home made telescope mount.
The issues I have at the moment is hopefully very simple (But quite difficult for me!)
As an example say I have a button, I want to execute a loop when the left mouse button is held down, (which will be a continuous stream of 232 data), then when the left mouse button is released I need the loop to stop and to execute another line of code.
I sincerely hope that information I have given is enough and somebody is kind enough to help me along (I have searched the internet for answers believe me!)
Many thanks.
Hook into the MouseDown and MouseUp events on the button. The MouseDown event should spawn a thread, or signal to the thread to begin executing the loop. The MouseUp event should signal to the thread to stop executing the loop.
Something like this: