Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6706137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:29:05+00:00 2026-05-26T07:29:05+00:00

Is there an analog to the following static function from the Qt library in

  • 0

Is there an analog to the following static function from the Qt library in Windows Forms?

http://doc.qt.io/qt-5/qtimer.html#singleShot

The best I can come up with is the following:

ThreadPool.QueueUserWorkItem((o) =>
{
    Thread.Sleep(someNumberOfMilliseconds);
    DoDelayedWorkHere();
});

UPDATE

This does the trick using System.Windows.Forms.Timer.

var timer = new System.Windows.Forms.Timer();
timer.Interval = someNumberOfMilliseconds;
timer.Tick += (o, args) =>
    {
        timer.Stop();
        DoDelayedWorkHere();
    };
timer.Start();         
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:29:06+00:00Added an answer on May 26, 2026 at 7:29 am

    QTimer is a synchronous timer, just like the Winforms Timer. Threading or one of the other Timer classes is not a substitute. A single-shot is easy to implement, just set the timer’s Enabled property to false in the Tick event handler. No danger of a race:

        private void timer1_Tick(object sender, EventArgs e) {
            ((Timer)sender).Enabled = false;
            // etc..
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any analog to Django forms ( http://docs.djangoproject.com/en/dev/topics/forms/?from=olddocs ) in ASP.NET MVC 2?
Is there in Windows API or in MFC any analog to atoh() function? atoh()
Is there some Linux analog of windows function GetAsyncKeyState() ? Or maybe there exists
Is there any analog of django's forms in Ruby on Rails? Thanks, Alexey Zakharov
Suppose it's a nub question, but is there an analog of MySQL's LIKE function
Is there in HTML 5 filtering language or some analog of filter language? Something
There is String.Format function that is referred to in the documentation as the analog
Is there analog og the MySQL's time_to_sec() ? I heed to perform query like
Is there an analog of the -fdefault-real-8 gfortran (the GNU Fortran 95 compiler) option
Is there a ColdFusion analog for the deployment descriptor/web.xml file found in a J2EE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.