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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:40:55+00:00 2026-06-14T06:40:55+00:00

I have a Windows form with Timer component, by default (design) the timer is

  • 0

I have a Windows form with Timer component, by default (design) the timer is enabled, but based on some arguments sent to the form I disable the timer on form_load.

I’m facing a very weird scenario, the Timer_Tick event is sometime fired even before the form_load is fired, this happen with the application minimized for 20 mins for example, then I open the application and trying to open new form, especially on slow systems.

Code as follow:

'=============== Code of the form with Timer
Public Sub OpenForm(SomeParams)
        'Set Form Properties
        Me.Show() 'Here the event Form_Load fired
End Sub

Private Sub Form_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  'Some Code ...
  Timer1.Enabled = False/ True 'Based True or false based on parameters
 'Code ...
End Sub

Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
  'Code here
  'The code raise error if form load is not fired, because need info from params ...
End Sub



'=============== Code in the calling form (MainForm)
'Calling the Form
dim obj As new Form1  'I think form this line the Timer1_Tick Fired, before load
obj.OpenForm(Params)

When the exception raised, I close the handled exception and try to open the form again it open the form with Timer1 is disabled.

I know the solution is trivial, just make the timer disabled by default, then enabled based on the params, but I want to know WHY the Timer1_Tick sometime is fired before OpenForm Sub and Before Form1_Load Sub !! ?

Many thanks for your time.
Sameh

  • 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-14T06:40:56+00:00Added an answer on June 14, 2026 at 6:40 am

    You declare and initalize your timer in the InitializeComponent of the form, called inside the form constructor. This starts immediately your timer, then you exit from the form constructor and before the form shows (which raises the Form_Load event) the allotted interval passes.
    This situation could be increased in the case of an idle app swapped away in the virtual memory on disk. The reloading in physical memory requires more time.
    You could test my hypothesis decreasing the Interval value.
    You should get more Timer_Tick events before the form load event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen variations of this by googling it but I have a windows form
I have a windows app which is just a form with a timer control
I am using a System.Windows.Forms.Timer component on an application's main form which checks every
I have a windows form which is a countdown Timer. What is the best
I have this windows form, timer1 is enabled and it's interval is set to
I have a windows form application that will open other forms, but will only
I have a timer set for 10 seconds at one of my windows form.
I have a form with label that is updating by System.Windows.Forms.Timer control every 2
I have one windows form file that each time I open it in Visual
I have a windows form application. On the form there are three groupboxs. Each

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.