Thema: Delphi Fehler im FormCreate

Einzelnen Beitrag anzeigen

Benutzerbild von MarvinM
MarvinM

Registriert seit: 24. Jul 2006
94 Beiträge
 
#21

Re: Fehler im FormCreate

  Alt 9. Dez 2006, 18:01
Du wirst bestimmt Verständnis dafür haben, dass ich nicht den Quellcode meines Jugend-forscht Projekts komplett offenlege, aber soweit:

Der Code des Hauptformulares:

Delphi-Quellcode:
unit uHaupt;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Spin, ExtCtrls, ComCtrls, Menus, Buttons, OleCtrls, SHDocVw, IniFiles, uNeutral;

type
  THaupt = class(TForm)


procedure THaupt.Datei_NeutralClick(Sender: TObject);
begin
  Neutral := TNeutral.Create(Haupt);
end;

end.
Der Quellcode von uNeutral:

Delphi-Quellcode:
unit uNeutral;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Buttons, ExtCtrls, uFrontEndNeutral, OleCtrls, SHDocVw, Menus;

type
  TNeutral = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    WebAnzeige: TStrings;
    constructor Create( AOwner: TComponent);
  end;

var
  Neutral: TNeutral;

  Zeichne: TZeichnen;


implementation



{$R *.DFM}

constructor TNeutral.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  WebAnzeige := TStringList.Create;
end;

procedure TNeutral.FormCreate(Sender: TObject);
begin
  Zeichne := TZeichnen.Create;
  
  FehlerLabel.Caption := '';
  Zeichne.Enable(false);
end;

end.
Und zu Guter letzt der Code von uFrontEndNeutral:

Delphi-Quellcode:
unit uFrontEndNeutral;

interface

uses
  classes,
  UKonstante,
  Graphics,
  SysUtils,
  FileCtrl;

type
  TZeichnen = class(TObject)
  public
    procedure Enable(Direction: Boolean);
  end;

implementation

uses
  uNeutral;

procedure TZeichnen.Enable(Direction: Boolean);
begin
  with Neutral do
  begin
    EDecAnzAtomMitOH.Enabled := direction;
    EDecAnzOH.Enabled := direction;
    EIncAnzAtomMitOH.Enabled := direction;
    EIncAnzOH.Enabled := direction;
    SDecAnzSaeure.Enabled := direction;
    SDecAnzH.Enabled := direction;
    SIncAnzSaeure.Enabled := direction;
    SIncAnzH.Enabled := direction;
    ChkAnzMolekuele.Enabled := direction;
    ChkAnzTeile.Enabled := direction;
    HintAnzTeile.Enabled := Direction;
    HintAnzMolekuele.Enabled := direction;
    React.Enabled := Direction;
    EDecAnzAtomMitOH.Enabled := direction;
    EDecAnzOH.Enabled := direction;
  end;
end;

end.
Mfg Marvin

Carpe Diem! - Genieße den Tag! - [gr. Horaz]
> Meine Homepage - http://www.prettyprograms.de <
  Mit Zitat antworten Zitat