I am having a peculiar problem with the order in which FlowLayoutPanels are added in to the form's controls property. This is what I tried,
I added 7 FlowLayoutPanels in to a C# window application from left to right in vertical strips. Then I tagged the flow layouts as 1, 2, 3, ... 7 again from left to right. Now in the load handler of the form, I wrote the following snippet,
foreach (FlowLayoutPanel aDaysControl in this.Controls)
{
MessageBox.Show(aDaysControl.Tag.ToString());
}
I expected messages to appear in the order of 1, 2, ... 7. But I got it in the reverse order (7, 6, ...1). Could some one help me out with the mistake I did ??
Reason behind preserving the order,
I am trying to make a calendar control with each row representing a day. If a month starts from Wednesday, then I need to add a empty label to the first(Monday) and the second(Tuesday) row. So the order matters a bit