Thema: Delphi Find Component

Einzelnen Beitrag anzeigen

Benutzerbild von mirage228
mirage228

Registriert seit: 23. Mär 2003
Ort: Münster
3.750 Beiträge
 
Delphi 2010 Professional
 
#7
  Alt 26. Mär 2003, 17:49
du kannst auch der speichern prozedur als parameter das formular angeben! (alternative)

Delphi-Quellcode:
unit UnitFunc;

interface

uses SysUtils, ExtCtrls, StdCtrls, Controls, Classes, Graphics, Dialogs; {Standard-Units auf die zurückgegriffen wird}

    procedure Farbewechseln (Sender: TPanel; Button: TMousebutton);
    function Zeitangabe:string;
    function THL (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    function Sound (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    function Schloss (Sender: TImage; Button: TMousebutton; Bild: boolean): boolean;
    procedure speichern(formular: TForm);

implementation
procedure speichern(formular: Tform);
var save: Textfile;
    Hname, Zeit, HFarbe, kette: string;
    Schl, THL, Sound:boolean;
    i: integer;
begin
  kette := '';
  for i := 1 to 35 do
  begin
    kette := kette + ((Formular.FindComponent('PanLab' + IntToStr(i)) as TLabel) .Caption,
                  (Formular.FindComponent('PanLabT' + Inttostr(i)) as TLabel).caption,
                  IntToHex(((Formular.FindComponent('PanHalle' + InttoStr(i))as TPanel).Color),6),
                  BoolToStr(bildTHL[i]), BoolToStr(bildSchl[i]),BoolToStr(bildSound[i]));
  end;
end;
natürlich gehts auch mit Application.MainForm.FindComponent
David F.
  Mit Zitat antworten Zitat