Kod: Tümünü seç
uses
windows..unit1;
public
gelfr:tfromclass;
end;
type
TFormClass = class of TForm;
procedure...
begin
gelfr.kno:=10;//hata satırı kno yok diyor ama unit1 de uses de tanımlı
end;
Kod: Tümünü seç
uses
windows..unit1;
public
gelfr:tfromclass;
end;
type
TFormClass = class of TForm;
procedure...
begin
gelfr.kno:=10;//hata satırı kno yok diyor ama unit1 de uses de tanımlı
end;
Kod: Tümünü seç
with gelfr do begin
TSayisal(FindComponent('muskno')).Text:=DBGrid1.DataSource.DataSet.FIELDBYNAME('kno').VALUE;
TADBText(FindComponent('odano')).Text:=DBGrid1.DataSource.DataSet.FIELDBYNAME('odano').VALUE;
*****
if (gelfr is TUrsat) then
(gelfr as TUrsat).v[1]:=DBGrid1.DataSource.DataSet.FIELDBYNAME('calsek').VALUE;
if (gelfr is Trezrnf) then
(gelfr as Trezrnf).v[1]:=DBGrid1.DataSource.DataSet.FIELDBYNAME('calsek').VALUE;
***
end;
Kod: Tümünü seç
///unit
unit MyForm;
interface
uses dialogs,classes,forms;
type
TMyForm = class(TForm)
public
Referans : TMyForm;
deg:string;
end;
implementation
end.
// ana form
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Unit2,unit3,myform;
type
TForm1 = class(TMyForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
//from 2 goster
form2.referans := self;
form2.show;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
//from 3 goster
Form3.Referans := self;
form3.Show;
end;
end.
/// form 2
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,MyForm, StdCtrls;
type
TForm2 = class(TMyForm)
Button1: TButton;
Label1: TLabel;
Button2: TButton;
Label2: TLabel;
procedure FormShow(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
uses Unit3, Unit4;
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
begin
label1.Caption := self.Referans.Caption +' dan geldi';
end;
procedure TForm2.Button2Click(Sender: TObject);
begin
//ortak form
form4.referans := self;
form4.showmodal;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
//degeri goster
label2.caption:=deg;
end;
end.
//form 3
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,myform;
type
TForm3 = class(TMyForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
Button2: TButton;
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
uses Unit4;
{$R *.dfm}
procedure TForm3.Button2Click(Sender: TObject);
begin
//ortak form
form4.referans := self;
form4.showmodal;
end;
procedure TForm3.Button1Click(Sender: TObject);
begin
//degeri goster
label2.caption:=deg;
end;
end.
// bu ortak form
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,MyForm;
type
TForm4 = class(TMyForm)
Edit1: TEdit;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.DFM}
procedure TForm4.Button1Click(Sender: TObject);
begin
Referans.deg:=edit1.text;
close;
end;
end.
Kod: Tümünü seç
I := MyTList.Add(TMyForm.Create(Application));
TMyForm(MyTList.Items[I]).Tag := I;
Kod: Tümünü seç
TMyForm( MyTList.Items[ Self.Tag ]).Caption := Inttostr( Self.Tag )+'. Index';