Announcement

Collapse
No announcement yet.

Form in einem anderen Form aufrufen mit "Parent" - MDI Simulation

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form in einem anderen Form aufrufen mit "Parent" - MDI Simulation

    Ich möchte gern unter Delphi7 ein Form2 im Form1 aufrufen.<br>
    Unter Delphi 5 habe ich mehrerer Programme mit folgendem Code erstellt:<br><br>

    procedure TForm1.Button1Click(Sender: TObject);
    <br>
    begin<br>
    Form2.Parent := Form1;<br>
    Form2.Borderytyle := BSNone;<br>
    Form2.Windowstate := WSMAximized;<br>
    Form2.Show;<br>
    end;<br>
    <br>
    In Delphi7 bekomme ich zumindest teilweise mit dieser Vorgehensweise Schutzverletzungen (versuchte einen Fehler in ntdll.dll...oder so).
    <br>
    Ich kenne auch die neuere Möglichkeit von Herrn Kosch mit den "CreateParams/override" des Formulars Form2.
    <br>
    Allerdings verstehe ich nicht, warum das bei meinen Delphi5-Apllikationen immer so einfach ging und jetzt auf einmal unter D7 zu Fehlern führt...
    <br>
    Kann mir da jemand weiter helfen ?

  • #2
    Hallo,

    ... und jetzt auf einmal unter D7 zu Fehlern führt...

    derartige Änderungen sind dem "technischen Fortschritt" vorbehalten ;-)

    In seinem Blog hat es <i>Allen Bauer</i> (Borland) in einem ähnlichen Zusammenhang so formuliert: "<i>...
    it fixes an long-running bug in VCL that would allow a modal dialog show up behind another form on the screen giving the appearance of a hung application. The Delphi IDE would do this as well from time-to-time. With the introduction of Windows2000 and WindowsXP, Microsoft added a new feature called "window ghosting." If a top-level window hasn't processed a message within 5 seconds, Windows will "ghost" the form and allow you to drag, resize, and change the Z-order of the form, even though the application isn't processing any messages. The fact that it allows a Z-order change is what caused all the trouble. However, if the form had the WS_POPUP style and the "owner" was the correct window, even a "ghosted" form would not be allowed to switch Z-order to under it's owner, thus there is no chance for a modal dialog to suddenly disappear".</i&gt

    Comment

    Working...
    X