unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,inifiles,
StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
var inifile:Tinifile;
begin
inifile:=Tinifile.create('h:\l.ini');
with inifile do
begin
top:=readInteger('form','top',100);
left:=readInteger('form','left',100);
if readBool('form','initMax',false) then
begin
windowstate:=wsmaximized
end
else
windowstate:=wsNormal;
end;
inifile.free;
end;procedure TForm1.FormDestroy(Sender: TObject);
var inifile:tIniFile;
begin
IniFile:=TIniFile.Create('h:\l.ini');
with IniFile do
begin
writeInteger('Form','Top',top);
writeInteger('form','left',left);
writeInteger('Form','height',height);
writeBool('form','InitMax',WindowState=WsMaximized);
end;
inifile.free;end;end.
在delphi5下面一切正常!
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,inifiles,
StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
var inifile:Tinifile;
begin
inifile:=Tinifile.create('h:\l.ini');
with inifile do
begin
top:=readInteger('form','top',100);
left:=readInteger('form','left',100);
if readBool('form','initMax',false) then
begin
windowstate:=wsmaximized
end
else
windowstate:=wsNormal;
end;
inifile.free;
end;procedure TForm1.FormDestroy(Sender: TObject);
var inifile:tIniFile;
begin
IniFile:=TIniFile.Create('h:\l.ini');
with IniFile do
begin
writeInteger('Form','Top',top);
writeInteger('form','left',left);
writeInteger('Form','height',height);
writeBool('form','InitMax',WindowState=WsMaximized);
end;
inifile.free;end;end.
在delphi5下面一切正常!
解决方案 »
- 江湖英雄贴!各位高手请看!!!有高分奖励!
- 相同的数据库结构,在SQL SERVER2000中一切正常,可是到ACCESS出现问题
- 没人能搞定它吗?shbrowseforfolder函数?
- IdUDPClient 和 IdUDPServer进行图象的传输的问题
- MDI应用程序,把子窗体的做成DLL?
- 求java开源 hr!!!!!
- Delphi编的游戏--反击计划,大家帮忙测试,也许你也能成为设计师
- 俩数据集比较再重绘dbgrid困扰我一个星期了
- query中直接使用sql有错?
- 大家有没有看过《delphi深度历险》的?
- 请教:ReadComponent函数的用法
- delphi中能像vb那样定义控件数组吗?谢谢
你最好是将放在FormDestroy中的代码放在FormClose中