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 8872241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:10:39+00:00 2026-06-14T18:10:39+00:00

My application successfully detects the specific file I want to detect but the messagebox

  • 0

My application successfully detects the specific file I want to detect but the messagebox always showing not only once but many times I dont know what is wrong.

Side question is this a good way of always checking if a certain file exists? or there is more better and accurate way? if there is any suggestions or link will be a great help . Thanks!

Here is my code:

private void Form1_Load(object sender, EventArgs e)
        {
            timer1.Start();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            if (File.Exists(patch_to_checked))
            {
                MessageBox.Show("File Found!");
                timer1.Stop();
            }
        }
  • 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-14T18:10:40+00:00Added an answer on June 14, 2026 at 6:10 pm

    You should stop the timer as soon as you enter the function. Otherwise, the timer is ticking while the user is moving the cursor to the button to dismiss the message box:

        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Stop();
    
            if (File.Exists(patch_to_checked))
            {
                MessageBox.Show("File Found!");
            }
            else
            {
                timer1.Start();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully implemented a network application in visual CLR project using boost.asio. but
I have a C# application that uses a Windows service that is not always
I am exporting gridview to Excel in windows application successfully, but the problem is
I have a .NET 3.5 Setup Package Project which installs my application successfully. The
In my application,I successfully managed to encode/decode H264 video and Speex audio using libavcodec
I have an application that is successfully deploying on tomcat, which I must migrate
after successfully building my application the start fails because it relies on config files
I successfully got the application icons of the currently installed applications with the following
I have successfully created an application which is workable on the >3.0 devices. However,
I've successfully completed a Windows Forms application with MS Word integration - the application

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.