14.08.2010, 16:05
|
Прохожий
|
|
Регистрация: 03.08.2010
Сообщения: 48
Репутация: 10
|
|
Вы хоть в код загляните. В частности Uses
http://alfile.ifolder.ru/18893029 дописал пару строк
Форма 1
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
S: string;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
s:='Привет';
Form2.Show;
Form2.Label1.Caption:=s;
Form1.Label1.Caption:=i;
end;
end.
Форма 2
Код:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm2 = class(TForm)
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
i: string;
implementation
Uses Unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
i:='Привет';
end;
end.
Откуда по вашему переменная i взялась в первой форме?
|