I have a form which is an MDI container. In that form i generate 6 child forms each with a label:
for (int i = 0; i < 6; i++)
{
Form window = new Form();
window.Width = 100;
window.Height = 100;
window.MdiParent = this;
window.FormBorderStyle = FormBorderStyle.FixedToolWindow;
Label label = new Label();
label.AutoSize = true;
label.Location = new System.Drawing.Point(1, 1);
label.Size = new System.Drawing.Size(35, 13);
label.TabIndex = 1;
label.Name = "label" + i.ToString();
label.Text = window.Top.ToString();
window.LocationChanged += new System.EventHandler(HERE);
window.Controls.Add(label);
window.Show();
}
I added an event on the locationchanged for window. Now how do do it so that label updates to the windows position?