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

  • Home
  • SEARCH
  • 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 8952121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:48:21+00:00 2026-06-15T13:48:21+00:00

I have following code: Hide() if(a > b) { label.Text = a is greater

  • 0

I have following code:

Hide()
if(a > b)
{
label.Text = "a is greater than b";
Show();
Thread.Sleep(50000);
}

What i am trying to do is hide the winform as soon as app starts. If a>b at any point it will show the winform with that message in the label for 50 second and will hide again.
Also label is set to autosize = true;

Above code works but label is not showing any text? Also is this the right approch to show the winfor for sometime using thread sleep?

  • 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-06-15T13:48:22+00:00Added an answer on June 15, 2026 at 1:48 pm

    as above says, it is because the sleep, the UI does not have time to update it yet.

    however, you do not have to use timer. DoEvents() gives it some time to update UI.

    try

       Hide();
    if(a > b)
    {
        label.Text = "a is greater than b";
        Show();
        System.Windows.Forms.Application.DoEvents();
        Thread.Sleep(50000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code where I want to show / hide different text
I have the following code to hide an essay question or open text. I'd
I am using the following code to hide and show a label in my
I have the following html code:- <!DOCTYPE html> <html> <body> <fieldset> <legend> <button> Show/Hide
I have the following code: $(#submenuSolutions).mouseleave(function () { $(.submenuRightCurrent).hide(); $(.submenuRightCurrent).removeClass(submenuRightCurrent); $(#prasentRight).addClass(submenuRightCurrent); $(#prasentRight).addClass(submenuRightCurrent).stop(true,true).show(); $(.menuHover).removeClass(menuHover); $(this).stop(true,true).hide();
I have the following code: JS <script type=text/javascript> $(function(){ $('#fgotpwfield').hide(); $('#login_submit').click(function() { $('#form_result').fadeOut('fast'); $('#myccrxlogin
I have the following code to hide/show elements depending on what value is selected
I already have the following code to show/hide two form elements based on a
I have the following code: $('.breadcrumb:contains(,)').hide(); It does as expected and hides the entire
I have the following code: $(document).ready(function(){ $(.yearInner).hide(); $(.year, this).hover( function () { $(.yearInner, this).slideToggle();

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.