Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: Open the conditional form ? Pin
OriginalGriff27-Nov-16 21:14
mveOriginalGriff27-Nov-16 21:14 
AnswerRe: Open the conditional form ? Pin
Member 245846729-Nov-16 17:42
Member 245846729-Nov-16 17:42 
QuestionC# Labels Pin
Pavlex427-Nov-16 3:21
Pavlex427-Nov-16 3:21 
GeneralRe: C# Labels Pin
Kornfeld Eliyahu Peter27-Nov-16 3:25
professionalKornfeld Eliyahu Peter27-Nov-16 3:25 
GeneralRe: C# Labels Pin
Pavlex427-Nov-16 3:44
Pavlex427-Nov-16 3:44 
GeneralRe: C# Labels Pin
Kornfeld Eliyahu Peter27-Nov-16 3:50
professionalKornfeld Eliyahu Peter27-Nov-16 3:50 
GeneralRe: C# Labels Pin
Pavlex427-Nov-16 3:53
Pavlex427-Nov-16 3:53 
AnswerRe: C# Labels Pin
OriginalGriff27-Nov-16 5:06
mveOriginalGriff27-Nov-16 5:06 
Create an array (or a List) of Labels, and add the instances to that:
C#
private List<Label> labels = new List<Label();
private int currentLabel = 0;
...
   labels.Add(myLabel1);
   labels.Add(myLabel2);
   labels.Add(myLabel3);
   labels.Add(myLabel4);
   ...
Then in your click handler get the current label from the index:
C#
if (currentLabel < labels.Count)
   {
   Label lab = labels[currentLabel++];
   ... 
   }
else
   {
   ... Stop your timer ...
   }
You can then access the label directly, and do what you want with it.
Your Timer event can also use the labels collection and the index to decide which ones it should be "changing" and which ones it should leave alone.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

GeneralRe: C# Labels Pin
Pavlex427-Nov-16 20:27
Pavlex427-Nov-16 20:27 
GeneralRe: C# Labels Pin
OriginalGriff27-Nov-16 20:52
mveOriginalGriff27-Nov-16 20:52 
GeneralRe: C# Labels Pin
Pavlex427-Nov-16 21:07
Pavlex427-Nov-16 21:07 
GeneralRe: C# Labels Pin
OriginalGriff27-Nov-16 21:18
mveOriginalGriff27-Nov-16 21:18 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 5:54
mveGerry Schmitz28-Nov-16 5:54 
GeneralRe: C# Labels Pin
Pavlex428-Nov-16 6:45
Pavlex428-Nov-16 6:45 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 7:00
mveGerry Schmitz28-Nov-16 7:00 
GeneralRe: C# Labels Pin
Pavlex428-Nov-16 7:14
Pavlex428-Nov-16 7:14 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 7:24
mveGerry Schmitz28-Nov-16 7:24 
GeneralRe: C# Labels Pin
Pavlex428-Nov-16 8:03
Pavlex428-Nov-16 8:03 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 8:29
mveGerry Schmitz28-Nov-16 8:29 
GeneralRe: C# Labels Pin
Pavlex428-Nov-16 8:54
Pavlex428-Nov-16 8:54 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 10:23
mveGerry Schmitz28-Nov-16 10:23 
GeneralRe: C# Labels Pin
Pavlex428-Nov-16 10:36
Pavlex428-Nov-16 10:36 
GeneralRe: C# Labels Pin
Gerry Schmitz28-Nov-16 10:59
mveGerry Schmitz28-Nov-16 10:59 
GeneralRe: C# Labels Pin
Pavlex429-Nov-16 5:51
Pavlex429-Nov-16 5:51 
GeneralRe: C# Labels Pin
Gerry Schmitz29-Nov-16 6:01
mveGerry Schmitz29-Nov-16 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.