Ich habe ein Formular, das ein MDI-Container ist. In diesem Formular erstelle ich 6 untergeordnete Formulare mit jeweils einem Label:C# MDI Event Help
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();
}
Ich habe ein Ereignis für das Locationchanged für Fenster hinzugefügt. Nun, wie mache ich das, damit das Label die Windows-Position aktualisiert?
Funktioniert perfekt danke :) – Ozzy