Recurring Event in Forms App
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 2 of 2

Thread: Recurring Event in Forms App

  1. #1
    Join Date
    Apr 2012

    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!

  2. #2
    Join Date
    Jun 2010

    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.

    Quote Originally Posted by Quadu View Post
    I've looked around but can't seem to find something that specifically lists how to do this.
    I don't think it's really hard to find. There even is the small Timer icon in the toolbox (under Components).
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)