Autor Beitrag
Theophilus
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16


D6
BeitragVerfasst: Mi 14.01.04 17:51 
Ich habe folgendes seltsame Phänomen: Im Formular Main (ein leeres MDI-Fenster) wird über Menü-Aufruf Das Formular Form1 geöffnet, welches den Focus besitzt. Danach wird Form2 geöffnet, auf welches der Focus übergeht. Wird Form2 geschlossen, geht optisch der Focus wieder an Form1 über und der Cursor blinkt im zuletzt verwendeten Edit-Feld. Aber Form1Activate wird dennoch nicht aufgerufen!

Ich benötige aber das Activate-Event bei jedem Fenster-Wechsel. Was könnte da falsch laufen?

Moderiert von user profile iconTino: Titel geändert.
Böser Borstel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 154



BeitragVerfasst: Do 15.01.04 07:45 
setze doch bei TForm2.FormClose(Sender: TObject; var Action: TCloseAction); den focus wieder auf das Form1 dann sollte die TForm1.FormActivate(Sender: TObject); aufgerufen werden
Theophilus Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16


D6
BeitragVerfasst: Do 15.01.04 18:40 
Hallo B.B.,

ich habe deine Empfehlung einfach einmal ausprobiert, wohl wissend, dass sie bei einer MDI-Anwendung keine sinnvolle Lösung darstellt (wie soll ein Formular beim Schließen auswählen, an welches andere offene Formular der Focus übergeben werden soll?).
Überraschenderweise funktionierte es jedoch nicht, was mich zu näherer Untersuchung der Sache bewog. Das Ergebnis ist, dass der beschriebene Effekt dann auftritt, wenn Form2 modal ist.
Meine ursprüngliche Formulierung war also unpräzise. Das Problem lautet nun, wie bekommt ein Formular, das den Focus besitzt und in temporär an ein modales Formular abgibt, es mit, dass es wieder im Besitz des Focus ist?

Ciao