Einzelnen Beitrag anzeigen

Benutzerbild von Störtebeker
Störtebeker

Registriert seit: 9. Jul 2007
398 Beiträge
 
#11

Re: RichEdit --> vordefinierter Text

  Alt 22. Sep 2007, 22:00
procedure TForm4.TreeView1Change(Sender: TObject; Node: TTreeNode);
so sieht die Prozedur aus, in der das ganze steht.

Setzte ich

var Node: ...; dazu sagt Delphi: identifier redeclared.

Delphi-Quellcode:
unit help;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, ComCtrls, StdCtrls, ExtCtrls, Credits;

type
  TForm4 = class(TForm)
    TreeView1: TTreeView;
    SpeedButton1: TSpeedButton;
    Panel1: TPanel;
    SpeedButton3: TSpeedButton;
    SpeedButton2: TSpeedButton;
    RichEdit1: TRichEdit;
    procedure Button1Click(Sender: TObject);
    procedure TreeView1Change(Sender: TObject; Node: TTreeNode);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form4: TForm4;

implementation

{$R *.dfm}

procedure TForm4.Button1Click(Sender: TObject);
begin
close;
end;

procedure TForm4.TreeView1Change(Sender: TObject; Node: TTreeNode);
 begin
  if not Assigned(Node) then
    exit;
  if Node.Caption = 'TEXT1then
  begin
    RichEdit1.Lines.LoadFromFile('TEXT1.txt');
  end
  else if Node.Caption = 'TEXT2then
  begin
    RichEdit1.Lines.LoadFromFile('TEXT2.txt');
  end;
 end;
end;

end.
ist der gesamte Code der Form
"And he piled upon the whale´s white hump - a sum of all the rage and hate felt by his whole race.
If his chest had been a cannon, he would have shot his heart upon it."
  Mit Zitat antworten Zitat