Einzelnen Beitrag anzeigen

Tyrael Y.

Registriert seit: 28. Jul 2003
Ort: Stuttgart
1.093 Beiträge
 
Delphi 2007 Professional
 
#6

Re: Mainform erst anzeigen nachdem andere Form geschlossen w

  Alt 15. Aug 2005, 15:08
Mach dir zwei Formulare, eine Hauptform und eine Nebenform...


Hauptform
Delphi-Quellcode:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  THauptform = class(TForm)
    Label1: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Hauptform: THauptform;

implementation

uses Unit2;

{$R *.dfm}

procedure THauptform.FormCreate(Sender: TObject);
var LNebenForm: TNebenform;
begin
  Hauptform.Hide;

  LNebenForm := TNebenform.Create(self);
  try
    if LNebenForm.ShowModal = mrOk then
      HauptForm.Show;
  finally
    LNebenform.Free;
  end;
end;

end.
Nebenform:
Delphi-Quellcode:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TNebenform = class(TForm)
    Label1: TLabel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Nebenform: TNebenform;

implementation

{$R *.dfm}

procedure TNebenform.Button1Click(Sender: TObject);
begin
 ModalResult := mrOK;
end;

end.

..den Rest kannst du an deinen eigenen Code anpassen...


Gruß

Tyrael
Levent Yildirim
Erzeugung von Icons aus Bildern:IconLev
  Mit Zitat antworten Zitat