ну в ообщем не заработало
исходник от angvelem - работает - переменная передается.
сделал также = обе формы заполнил идентично с исходником angvelem:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls;
type
TForm1 = class(TForm)
Label1: TLabel;
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses Unit2;
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Hide;
Form2.N2 := 196;
Form2.Show;
end;
end.
Код:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm2 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
N2 : Integer;
end;
var
Form2: TForm2;
implementation
uses
Unit1;
{$R *.dfm}
procedure TForm2.FormShow(Sender: TObject);
begin
Label2.Caption := IntToStr(N2);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
Hide;
Form1.Show;
end;
end.
но у меня переменная из N2 Form1 в Form2 Label2.Caption := IntToStr(N2);
НЕ передается
может што то в свойствах форм или кнопки Speedbutton нужно записать?