Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 17.09.10 08:22 
Moin Forum,

ich zeige ein Formular modal an (per Druck auf einen Button auf meiner HauptForm), ein Button darauf hat in der Eigenschaft ModalResult mrCancel eingetragen.
Ich Zeige das Formular an:
ausblenden Delphi-Quelltext
1:
2:
3:
  if Formx.Showmodal then begin
    Mach Irgendwas...
  end;


Und schliesse es mit einem Druck auf die Escapetaste. Wenn ich es jetzt noch einmal anzeigen will, dann kommt die Fehlermeldung: "deaktiviertes oder unsichtbares Fenster kann den Fokus nicht erhalten"
Aber warum?

Gruß Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
zuma
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 660
Erhaltene Danke: 21

Win XP, Win7, Win 8
D7 Enterprise, Delphi XE, Interbase (5 - XE)
BeitragVerfasst: Fr 17.09.10 08:50 
Du setzt irgendwo in deinem Source den Focus bevor das Fenster angezeigt wird.
Hast du sowas wie setFocus verwendet ? dann probiere mal sowas wie

ausblenden Delphi-Quelltext
1:
2:
if Button.canFocus then
 Button.setFocus

_________________
Ich habe nichts gegen Fremde. Aber diese Fremden sind nicht von hier! (Methusalix)
Warum sich Sorgen ums Leben machen? Keiner überlebts!
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 17.09.10 08:55 
Fehler gefunden: Im OnShow des augerufenen Formulars wurde der Focus auf einen Button gesetzt.

Danke noch mal.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...