procedure TForm1Form.newAAA(TName:string); begin with Form1Form.StringGrid1 do begin RowCount:=RowCount+1; Cells[0,RowCount-1]:=TName; end; end;这样试试看
刚上来,部份代码如下:1.pub.pas//显示窗体 function ShowForm(AFormClass:TFormClass):Boolean;Overload; begin Screen.Cursor:= crHourGlass; with AFormClass.Create(Application) do begin Screen.Cursor:= crDefault; Position:=poScreenCenter; ShowModal; clearmemory; end; end; 2.窗体Aprocedure TAForm.newAAA(TName:string); begin with self.StringGrid1 do begin RowCount:=RowCount+1; Cells[0,RowCount-1]:=TName; end; end;procedure TAForm.FormShow(Sender: TObject); begin inherited; ShowForm(TBForm);//显示B窗体 StringGrid1.Cells[0,0]:='Job List';end;//B窗体里的按钮Click时 procedure TPauseForm.SaveClick(Sender: TObject); begin inherited; AForm.newAAA('111111'); close; end;
你上面写是class使用
begin
with Form1Form.StringGrid1 do
begin
RowCount:=RowCount+1;
Cells[0,RowCount-1]:=TName;
end;
end;这样试试看
function ShowForm(AFormClass:TFormClass):Boolean;Overload;
begin
Screen.Cursor:= crHourGlass;
with AFormClass.Create(Application) do
begin
Screen.Cursor:= crDefault;
Position:=poScreenCenter;
ShowModal;
clearmemory;
end;
end;
2.窗体Aprocedure TAForm.newAAA(TName:string);
begin
with self.StringGrid1 do
begin
RowCount:=RowCount+1;
Cells[0,RowCount-1]:=TName;
end;
end;procedure TAForm.FormShow(Sender: TObject);
begin
inherited;
ShowForm(TBForm);//显示B窗体
StringGrid1.Cells[0,0]:='Job List';end;//B窗体里的按钮Click时
procedure TPauseForm.SaveClick(Sender: TObject);
begin
inherited;
AForm.newAAA('111111');
close;
end;