[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

.Net timer

Posted on 2013-06-11
3
Medium Priority
?
384 Views
Last Modified: 2013-06-11
I have a timer on my page that is disabled and the interval on the timer is 1000

I assume that's milliseconds?

On a click event I want to

Timer1.Enabled = True
Timer1.start()

run for 15 seconds

Timer1.Stop
Timer1.Enabled = False
0
Comment
Question by:lrbrister
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 39237877
add integer field in your class and set it to 0.
on the timer elapse event handler add 1 to the integer field each time.
also check if the field equals 15, if yes then stop the timer and set .Enabled = false, and reset the integer field to 0 again.
0
 
LVL 1

Accepted Solution

by:
OSUK earned 2000 total points
ID: 39238271
My suggestion would be...

In the Click event put the code
Timer1.Interval = 15000  'yes the time is in milliseconds
Timer1.Start

Open in new window


In the Timer1_Tick event..
Timer1.stop
'Add whatever code you wish to process

Open in new window


If you can include a bit more detail of what you are trying to achieve with the timer i could provide more detail.
0
 

Author Closing Comment

by:lrbrister
ID: 39238298
THis had example code and  got me going.
Thanks...it's working

I have this
    Protected Sub lnkFrustrated_Click(sender As Object, e As EventArgs) Handles lnkFrustrated.Click
        tmrFrustrated.Interval = "19000"
        imgFrustrated.Visible = True
        tmrFrustrated.Enabled = True

    End Sub

    Private Sub tmrFrustrated_Tick(sender As Object, e As System.EventArgs) Handles tmrFrustrated.Tick
        tmrFrustrated.Enabled = False
        imgFrustrated.Visible = False
        lblImage.Text = "Have a nice day!"
    End Sub
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question