Einzelnen Beitrag anzeigen

Holger24

Registriert seit: 3. Aug 2008
5 Beiträge
 
#5

Re: Form2 aus Form1 ein-/ausblenden

  Alt 3. Aug 2008, 14:06
1.:
Delphi-Quellcode:
program LioRC_Client_Projekt;

uses
  Forms,
  LioRC_Client in 'LioRC_Client.pas{Form1},
  Unit3 in 'Unit3.pas{Form3},
  LioRC_Black in 'LioRC_Black.pas{Form2};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm3, Form3);
  Application.CreateForm(TForm2, Form2);
  Application.Run;
end.
2.:
Delphi-Quellcode:
unit LioRC_Client;

interface

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

const
  CPort = 4999;
  CIp = '127.0.0.1' ;

type TChatMessage = Record
        Nick: string[255];
        Command: string[255];
      end;


type
  TForm1 = class(TForm)
    MProtokoll: TMemo;
    BtStartStop: TButton;
    ClientSocket1: TClientSocket;
    Timer1: TTimer;

    procedure Timer(Sender: TObject);
    procedure Error(Sender: TObject; Socket: TCustomWinSocket;
      ErrorEvent: TErrorEvent; var ErrorCode: Integer);
    procedure Read(Sender: TObject; Socket: TCustomWinSocket);
    procedure Disconnect(Sender: TObject; Socket: TCustomWinSocket);
    procedure Connect(Sender: TObject; Socket: TCustomWinSocket);
    procedure initClientMaster(Sender: TObject);
    procedure BtStartStopClick(Sender: TObject);
  private
    { Private-Deklarationen }
    Verbunden: boolean;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;



implementation

uses Unit3, LioRC_Black;



{$R *.dfm}

procedure TForm1.BtStartStopClick(Sender: TObject);
begin
  form3.show;
end;
...

(Wenn ich form3.show auskommentiere, läuft alles)


3.:
Delphi-Quellcode:
unit Unit3;

interface

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

type
  TForm3 = class(TForm)
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form3: TForm3;

implementation

{$R *.dfm}

end.
[edit=Jelly]Bitte Delphi Tags nächstes Mal selber setzen Mfg, Jelly[/edit]
  Mit Zitat antworten Zitat