Sorry, this is not a solution, because you did not explain anything.
I just want to explain you the basic things. The title of the question itself already shows your misunderstanding: what is "run event". You should understand that
chartControl1_MouseMove
is not event or event instance. This is just the method. Now, it can be anything at all, but the name of the method suggests that this is an auto-generated method created by the Designer to handle the event
MouseMove
of the object
chartControl1
. (By the way, you should never use such names; everything auto-generated should be renamed somehow semantically; in this is a good tool to tell unattended symbol from the ones properly used.)
This method does not run as a thread method due to its signature. A thread needs a parameter-less method, static or instance one; another signature is the one accepting one object. I recommend never pass a parameter to the thread in this way, because of required type casting; I proposed much better method based on passing "this"; which is practically means using a non-static (i.e. instance) method and a thread wrapper. See my past solutions
How to pass ref parameter to the thread[
^] and
change parameters of thread (producer) after it started[
^].
Now, I have no idea why would you even think about doing something with the mouse event handler in a separate thread, but cannot make any sense. For just one thing, mouse event processing is an integral part of UI and could never be processed in a non-UI thread.
As to the communication with your electronic device, I would strongly recommend to get back to a separate thread. Only you should work with the IU using invocation mechanism, see below. As to the regular intervals: I don't think you need strictly regular time intervals. In case you really need good accuracy in timing, timer won't help you anyway, but working with the timer accurately is much more difficult. Threads are at least reliable. One thing about thread: for better (much better accuracy) don't use
System.Windows.Forms.Timer
— it's very bad. Use
System.Threading.Timer
or
System.Timers.Timer
.
For more about threading with UI, please see my past solutions:
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^],
Control.Invoke() vs. Control.BeginInvoke()[
^],
Problem with Treeview Scanner And MD5[
^].
—SA