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

C#

 
GeneralRe: Multi-threading in a web service Pin
Andy Brummer29-Apr-04 6:39
sitebuilderAndy Brummer29-Apr-04 6:39 
GeneralRe: Multi-threading in a web service Pin
Heath Stewart29-Apr-04 6:49
protectorHeath Stewart29-Apr-04 6:49 
GeneralRe: Multi-threading in a web service Pin
mjmcinto29-Apr-04 12:44
mjmcinto29-Apr-04 12:44 
GeneralRe: Multi-threading in a web service Pin
Heath Stewart29-Apr-04 14:24
protectorHeath Stewart29-Apr-04 14:24 
GeneralRe: Multi-threading in a web service Pin
mjmcinto30-Apr-04 2:45
mjmcinto30-Apr-04 2:45 
GeneralRe: Multi-threading in a web service Pin
Heath Stewart30-Apr-04 3:14
protectorHeath Stewart30-Apr-04 3:14 
Generalprinting multiple pages Pin
nmah29-Apr-04 5:07
nmah29-Apr-04 5:07 
GeneralRe: printing multiple pages Pin
Heath Stewart29-Apr-04 5:37
protectorHeath Stewart29-Apr-04 5:37 
Use a for loop instead with the current index as a field in your class initialized to 0. then use a for loop like so:
for ( ; i < Controls.Count; i++)
{
  Label lbl = Controls[i] as Label;
  // ...
}
Here, i would be a field in your class declared something like:
private int i = 0;
FYI, your foreach loop has a major flaw: if a control in the Controls collection is not a Label, an exception would be thrown. This may not be applicable in your application now (if panel1 contains only Labels), but if you ever add anything else your code will throw a cast exception.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: printing multiple pages Pin
nmah29-Apr-04 7:26
nmah29-Apr-04 7:26 
GeneralRe: printing multiple pages Pin
Heath Stewart29-Apr-04 8:28
protectorHeath Stewart29-Apr-04 8:28 
GeneralRe: printing multiple pages Pin
nmah29-Apr-04 8:32
nmah29-Apr-04 8:32 
GeneralRe: printing multiple pages Pin
..Hubert..29-Apr-04 5:42
..Hubert..29-Apr-04 5:42 
GeneralScrewed up a service. Pin
Xian29-Apr-04 4:58
Xian29-Apr-04 4:58 
GeneralRe: Screwed up a service. Pin
Heath Stewart29-Apr-04 5:24
protectorHeath Stewart29-Apr-04 5:24 
GeneralRe: Screwed up a service. Pin
Xian29-Apr-04 5:47
Xian29-Apr-04 5:47 
QuestionHow to Make a MDI form itself XP theme aware Pin
TaoLi29-Apr-04 3:54
TaoLi29-Apr-04 3:54 
AnswerRe: How to Make a MDI form itself XP theme aware Pin
Heath Stewart29-Apr-04 4:25
protectorHeath Stewart29-Apr-04 4:25 
AnswerRe: How to Make a MDI form itself XP theme aware Pin
Heath Stewart29-Apr-04 4:27
protectorHeath Stewart29-Apr-04 4:27 
GeneralRe: How to Make a MDI form itself XP theme aware Pin
TaoLi29-Apr-04 4:37
TaoLi29-Apr-04 4:37 
GeneralRe: How to Make a MDI form itself XP theme aware Pin
Jon G29-Apr-04 5:24
Jon G29-Apr-04 5:24 
GeneralRe: Calling an exported Function - Issue with different calling convention in C# Pin
Heath Stewart29-Apr-04 3:09
protectorHeath Stewart29-Apr-04 3:09 
QuestionRichTextBox-Coul you help me out? Pin
kumaru_san29-Apr-04 2:31
kumaru_san29-Apr-04 2:31 
GeneralNewbie: login screen Pin
ziwez029-Apr-04 2:15
ziwez029-Apr-04 2:15 
GeneralRe: Newbie: login screen Pin
Heath Stewart29-Apr-04 4:14
protectorHeath Stewart29-Apr-04 4:14 
Generalnetzwerk / network Pin
Anonymous29-Apr-04 1:56
Anonymous29-Apr-04 1:56 

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.