April 13th, 2012, 01:13 AM
Recurring Event in Forms App
Hi, sorry this is a relatively newbie question, but how would I go about specifically creating an event that happens on a timed basis in a windows form application?
To provide detail of what I actually am trying to do, I want to create a UI that displays the current status of a program running on a microcontroller via serial communication. I can currently open the serial port and read in & update on a button press, but what I want the forms app to do is repeatedly be checking the serial port, then processing the information and displaying it to the user. I am currently unsure of how to create an event that repeatedly occurs on a timed basis rather than on prompting.
I would want to check the serial port to see if any messages were received maybe 10 times / second and have it update the display on-screen.
I've looked around but can't seem to find something that specifically lists how to do this.
Any help or pointers to appropriate resources would be much appreciated, thanks!
April 13th, 2012, 06:34 AM
Re: Recurring Event in Forms App
Have a look at the System::Windows::Forms::Timer class. You can drag the timer from the Forms Designer's toolbox to the form and then conveniently set up its most important proprties and the tick event handler with the IDE.
I don't think it's really hard to find. There even is the small Timer icon in the toolbox (under Components).
Originally Posted by Quadu
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.