inifilename:=ExtractFilePath(Application.ExeName)+'form.ini';
forminifile:=tinifile.create(inifilename);
formname:=kminifile.readstring('form','formname','');
if application.FindComponent(formname)=nil then
创建窗体
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
form_var : TForm;
i : integer;
begin
for i := 0 to Screen.FormCount - 1 do
begin
if Screen.Forms[i].Name = 'Form2' then //Form2你可以从INI读到的String就行了
begin
form_var := Screen.Forms[i];
form_var.ShowModal;
break;
end;
end;
end;