How to display different messages on a label

Posted on 2011-10-24
Last Modified: 2012-05-12
I want to display different messages on a label at intervals of 2 sec using timer.  sliding down.


Question by:abgconsulting
    LVL 17

    Assisted Solution

    LVL 9

    Accepted Solution

    Try some this like this

            public void startTimer()
                timer1.Enabled = true;
                timer1.Tick += new System.EventHandler(OnTimerEvent);       
            public void OnTimerEvent(object sender, EventArgs e)
                timer1.Interval = 2000;
                label1.Text = DateTime.Now.ToLongTimeString();

    Open in new window

    add a label and timer
    copy both procedures and call the startTimer()
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    WinForms or WebForms?

    Assumming WinForms, use a Timer control to get an event every 2 seconds.  To get the "sliding down" feature, change the Location() property in a Loop.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Suggested Solutions

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now