Hallo,
mein Problem betrifft eine Klasse, die von "Form" ableitet".
Es gibt einen Button, der wie folgt aussieht:
C#-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
| private void button1_Click(object sender, EventArgs e) { textBoxStatus.Text = "Verbinde zu Server..."; ftp = new FTPclient("unitedserver.de", "web1f229", "6ri554tOp?Gs"); if (testFTPConnection()) { button1.Enabled = false; fileInformation = new OFileInformations(); textBoxStatus.Text = "Suche vorhandene Dateien..."; fileInformation.init(this, ftp);
listBox1.Sorted = true; listBox1.BeginUpdate();
foreach (String s in fileInformation.allFileNames()) this.listBox1.Items.Add(s);
listBox1.EndUpdate(); textBoxStatus.Text = "fertig"; } } |
Das Problem ist, dass das Form etwa 10 Sekunden nicht reagiert und dann in der textBoxStatus nur noch "fertig" steht. Alles andere wurde nicht anzeigt.
Wie kann ich das Problem beheben und die anderen Status dem Benutzer anzeigen?
Gruß
Alex