473,396 Members | 2,082 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Timers

I have 6 labels that I want to display, one at a time, in 15 second intervals. After all 6 have
been displayed, I want to restart, displaying all 6 again, continuously.
Experimenting with just 2 labels and 1 timer, I set the timer Interval accordingly, then I make
Label1.visible False, and Label2.visible True, and this works fine, but I'm a bit confused as to
how to continue with Labels 3 - 6, and how to restart at #1 again.
Earl
Jun 27 '08 #1
7 943
"Earl Partridge" <ea*****@pearnet.comwrote in message
news:eB**************@TK2MSFTNGP06.phx.gbl...
I have 6 labels that I want to display, one at a time, in
15 second intervals. After all 6 have been displayed,
I want to restart, displaying all 6 again, continuously.
If you are using Visual Basic then you can create an array of Labels with
indexes 0 to 5 (or 1 to 6 or whatever you are most comfortable with) and
then in the Timer routine you can set up a Static variable as a counter and
refer to each of the Labels in turn using its Index property, incrementing
the counter each time the Timer routine fires. When you get to the last
Label in the array then simply set your Static variable back to 0 (or 1 or
whatever is the Index of the first Label in the array).

Mike

Jun 27 '08 #2
On 2008-04-25, Earl Partridge <ea*****@pearnet.comwrote:
I'm afraid I'm out of my league, having done no VB programming for about the
past
12 years... never got into "collections". I may have to try that array
suggestion Mike
Williams suggested.

As for Lloyd's suggestion for list(of label), would that coding go for the
form.load or
in the timer section? Would there be an example somewhere I could view?
Mikes solution is not going to work for you... Simply because there is
no such thing as a control array in VB.NET. He is purposely suggesting
a VB6 solution to a VB.NET problem.

All I can tell you is that Collections are fundamental part of
progamming in any language, so it's a good a time as any to learn them
:)

Queue(Of T) and List(Of T) are located in the System.Collections.Generic
namespace. Which is a good place to start in the documentation...

--
Tom Shelton
Jun 27 '08 #3
On Apr 24, 10:18*pm, "Cor Ligthert[MVP]" <notmyfirstn...@planet.nl>
wrote:
Tom and Loyd

I don't think that a whatever list or collection here has any advantage over
a simple array of labels.

dim timerLabels(5) = {Label1, label2, label3, label4, label5, label6}
older VB versions from this milenium than version 2008
dim timerLabels(5) as label = {Label1, label2, label3, label4, label5,
label6}

This is in my idea here the most effective, because it is just a fixed
array.

(This also written because of the confusion by the OP about a control array,
of course there can be arrays of controls, they don't however have that
limited use as in VB versions from the previous milenium).

Cor
An array works as well. I was leaning towards a queue initially,
simply because of the fact that it can self rotate - no need of the
extra variable to track the index :)

--
Tom Shelton
Jun 27 '08 #4
"Tom Shelton" <to*********@YOUKNOWTHEDRILLcomcast.netwrote in message
news:eW**************@TK2MSFTNGP03.phx.gbl...
Mikes solution is not going to work for you... Simply
because there is no such thing as a control array in
VB.NET. He is purposely suggesting a VB6 solution
to a VB.NET problem.
.. . . in exactly the same way that Bill McCarthy, who has been trolling the
VB6 group for months, purposely suggests vb.net solutions to VB6 questions
on the VB6 group. I've only just started doing it here. McCarthy has been
doing it for months on the VB6 group. Perhaps he might like to sop doing it?

Mike

Jun 27 '08 #5

"Mike Williams" <mi***@whiskyandCoke.comwrote in message
news:up**************@TK2MSFTNGP03.phx.gbl...
"Tom Shelton" <to*********@YOUKNOWTHEDRILLcomcast.netwrote in message
news:eW**************@TK2MSFTNGP03.phx.gbl...
>Mikes solution is not going to work for you... Simply
because there is no such thing as a control array in
VB.NET. He is purposely suggesting a VB6 solution
to a VB.NET problem.

. . . in exactly the same way that Bill McCarthy, who has been trolling
the VB6 group for months, purposely suggests vb.net solutions to VB6
questions on the VB6 group. I've only just started doing it here. McCarthy
has been doing it for months on the VB6 group. Perhaps he might like to
sop doing it?
Let it go Mike. Folks here have asked you to stop trolling, and folks in
the Vb6 forum have also told you to stop trying to start flames by your
constant attacks on folks.
As fun as it is to humor you, over the last two weeks you've waged many
personal attacks on me, first claiming I was someone else, then some other
silly conspiracy rant, and most recently your dishonest attack on me because
you say I didn't correct Cor. Your above claim that I provide .net answers
to VB6 questions is in fact a lie, another figment of your imagination
again. I have only provided dotnet answers to dotnet questions.
Oh, and if you think you can bully or intimidate me, you're going to learn a
lesson the hard way. I suggest you talk to folks who know me, as I can
assure you I have been around the VB forums while you were still driving
taxis for a living. The best advice I can give you now Mike, is listen to
the advice everyone is giving you, and desist from any further attacks.

HTH's.

Jun 27 '08 #6

"Mike Williams" <mi***@whiskyandCoke.comwrote in message
news:eC**************@TK2MSFTNGP03.phx.gbl...
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:6d**********************************@a22g2000 hsc.googlegroups.com...
>Sigh, Please tell me I'm not going to have to treat you
like I used to treat aaron kempf and follow you through
the threads and mark them as trolling attempts?

Yep. That's what it looks like you're going to have to do.
Look Mike, everybody, even your wife has told you to stop.

Jun 27 '08 #7
"Bill McCarthy" <Bi**@N0SPAM.comwrote in message
news:us**************@TK2MSFTNGP04.phx.gbl...
Look Mike, everybody, even your wife has told you to stop.
I'll stop when you do. You started this business. Stop trolling the VB6
group.

Mike


Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: GDumencu | last post by:
I have a C# program that have to run all the time. For some reasons I cannot make it a service. This program has 3 timers and by time to time ( days or weeks) one of them stops. Some times, starts...
0
by: Dmitry Demchuk | last post by:
Hi everybody. Recently I ran into situation with System.Threading.Timer in my ASP.NET application. I reinstalled Windows on one of my servers and got timers stop firing events after while, they...
0
by: Cider123 | last post by:
I was originally using: System.Windows.Forms.Timer It started to lock my Window Service up, so I went to the next evolution: System.Threading.Timer All was good. I was using it to send...
3
by: Nathan Kovac | last post by:
I have a feeling I am missing something simple, but I just can't find it. Perhaps someone can give me a lead on where to look. I will describe the issue then post my code to the web service. My...
3
by: Jeff Greenland | last post by:
Hello everyone, I am having problems with Timers in a web application. They just seem to stop running after 15 minutes or so. My web application is set up like this: When a user hits a...
9
by: Mark Rae | last post by:
Hi, I've seen several articles about using System Timers in ASP.NET solutions, specifically setting them up in Global.asax' Application_OnStart event. I'm thinking about the scenario where I...
10
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have...
5
by: Michael C# | last post by:
Hi all, I set up a System.Timers.Time in my app. The code basically just updates the screen, but since the processing performed is so CPU-intensive, I wanted to make sure it gets updated...
1
by: | last post by:
Frustrated.. (I have seen other posts regarding this problem with no resolution..) I am using dotnet 1.1 with latest SP on a Win2KP box (actually 2 boxes), have even run the service on WinXP SP2...
1
by: Jonathan Woods | last post by:
Hi there, I have three methods these need to execute at every interval time. I would like to know which option is better? Option A) Three System.Timers.Timer objects these execute each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.