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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:01:35+00:00 2026-05-30T22:01:35+00:00

I got this timer (timer2) and it runs every 60 seconds.. And I got

  • 0

I got this timer (timer2) and it runs every 60 seconds..
And I got this second timer (timer4)

when 60 seconds are over, the timer2_Tick does a few things and initiates timer4.
timer 4 makes sure to wait 4 seconds before coming in action (I need 4 seconds to be sure that all the downloaded data is there)

when these 4 seconds are over the timer should change an image and it does..
So it all works..

The problem is that every 4 seconds the image blinks.. the image is inside an datta template..

how do I stop that..?? do i need the Stop() or do I need an running counter..??

please help this is driving me nuts..

    private void timer2_Tick(object sender, EventArgs e )
    {
        locationTextBox2.Text = "";

        if (locationTextBox2.Text == "")
        {
            Weatherframe.Source = (ImageSource)new ImageSourceConverter().ConvertFromString("");
        }

        Weatherframe2.Source = Weatherframe.Source; 

        System.Windows.Threading.DispatcherTimer timer4 = new System.Windows.Threading.DispatcherTimer();
        timer4.Interval = new TimeSpan(0, 0, 0, 4, 000); // 500 Milliseconds
        timer4.Tick += new EventHandler(timer4_Tick);
        timer4.Start();

    }

    void timer4_Tick(object sender, EventArgs e)
    {
        if (locationTextBox2.Text == String.Empty)
        {
            locationTextBox2.Text = textBlock2.Text;
        }
    }
  • 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-30T22:01:36+00:00Added an answer on May 30, 2026 at 10:01 pm

    You never stop the timer, so it will keep ticking every fourth second.

    Just call Stop on the timer in the handler, but for that you need to keep the reference to the timer in a member variable so that you can access it after you created it.

    System.Windows.Threading.DispatcherTimer timer4;
    
    private void timer2_Tick(object sender, EventArgs e )
    {
        locationTextBox2.Text = "";
    
        if (locationTextBox2.Text == "")
        {
            Weatherframe.Source = (ImageSource)new ImageSourceConverter().ConvertFromString("");
        }
    
        Weatherframe2.Source = Weatherframe.Source; 
    
        timer 4 = new System.Windows.Threading.DispatcherTimer();
        timer4.Interval = new TimeSpan(0, 0, 0, 4, 000); // 500 Milliseconds
        timer4.Tick += new EventHandler(timer4_Tick);
        timer4.Start();
    
    }
    
    void timer4_Tick(object sender, EventArgs e)
    {
        timer4.Stop();
        if (locationTextBox2.Text == String.Empty)
        {
            locationTextBox2.Text = textBlock2.Text;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so we've got this event. Awesome, right? We've also got a timer with
In my WinForms application I have a timer which 'ticks' every second. In the
I got this timer tick function: Private Sub controlTick(ByVal sender As Object, ByVal e
I've got a timer that won't trigger the associated function when the time runs
This question about Timers for windows services got me thinking: Say I have (and
I've got this date time string: post[date] = 2007-07-18 10:03:19 I'd like to extract
I got this idea a long time ago when i saw an app do
Some time ago I got this error when building ANY Visual Studio Deployment project.
I've got a reasonably simple query (this time) that I need ALL the results
Got this line of code here but its not working. private void Button_Click(object sender,

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.