unit song;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,question;
type
TForm1 = class(TForm)
Label1: TLabel;
procedure Label1Click(Sender: TObject);
procedure Label2Click(Sender: TObject);
private
{ Private declarations }
public
temp_id:string;
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Label1Click(Sender: TObject);
begin
temp_id:=trim(label1.Caption) ;
label1.Font.Color :=clHighlight;
form2.Show ;
end;
想把变量temp_id传到form2窗体中,如下:
unit question;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,StdCtrls, DB, ADODB;
type
TForm2 = class(TForm)
Label1: TLabel;
ADOConnection1: TADOConnection;
DataSource1: TDataSource;
ADODataSet1: TADODataSet;
Label2: TLabel;
Memo1: TMemo;
Button1: TButton;
Button2: TButton;
procedure FormCreate(