<g6***@yahoo.co.uk> wrote in message
news:11*********************@u72g2000cwu.googlegro ups.com...
Hi All
Newbie to C# I am afraid
The array of panel dispays OK but I am having problems with accessing
the controls within.
My panels each have a number of label controls. How do I set, say, the
Name.Text property in List<Panel> ListPanelArray
when I put var. into the following does it does not give me the Name
option for the label contol Name.
foreach (Panel var in ListPanelArray)
{
var.
}
Any ideas please
Regards
Geoff
First, foreach is a read only repetition structure.
From the C# Programmer's Reference:
The foreach statement repeats a group of embedded statements for each
element in an array or an object collection. The foreach statement is used
to iterate through the collection to get the desired information, but should
not be used to change the contents of the collection to avoid unpredictable
side effects.
Here are a couple of articles that may be of interest:
http://msdn.microsoft.com/library/de...witharrays.asp http://msdn.microsoft.com/library/de...ollections.asp