zxjrainbow
31229
|
2007/9/21 10:47:30 |
太厉害了,强人啊。 支持啊~ |
alllove
31219
|
2007/9/20 15:07:39 |
支持下,做出来的是效果真的很好! |
cheyp
31213
|
2007/9/20 10:57:46 |
能否出个delphi7的示例 |
dlp
31201
|
2007/9/19 13:50:34 |
应该是
在调用 EndDesign 后,调用 SvaeStateComps 来保存。 |
jacket84
31200
|
2007/9/19 10:48:30 |
为什么在delphi7里面不能够用啊? |
swgame
31192
|
2007/9/18 18:01:51 |
tpcnyou 不错,使用INI来保存位置. |
cheyp
31191
|
2007/9/18 17:06:14 |
我用的delphi7 |
cheyp
31190
|
2007/9/18 17:05:42 |
为什么我打开的源代码是空的 |
tpcnyou
31185
|
2007/9/18 15:31:40 |
写了两个函数 在调用 BeginDesign 后调用 下 SvaeStateComps 在form Create时调用 RestoreStateComps 可实现保存和装载 Components 位置
procedure SaveStateComps(aForm: TCustomForm); var i: Integer; oFName: string; ini: TIniFile; WC: TWinControl; begin oFName := ExtractFilePath(ParamStr(0)); //(Application.ExeName); if oFName[Length(oFName)] <> '\' then oFName := oFName + '\'; oFName := oFname + aForm.Name + '.GzFS'; Ini := TIniFile.Create(oFName); try for i := aForm.ComponentCount - 1 downto 0 do begin if aForm.Components[i] is TWinControl then begin ini.WriteInteger(aForm.Components[i].Name, 'Left', TWinControl(aForm.Components[i]).Left); ini.WriteInteger(aForm.Components[i].Name, 'Top', TWinControl(aForm.Components[i]).Top); ini.WriteInteger(aForm.Components[i].Name, 'Width', TWinControl(aForm.Components[i]).Width); ini.WriteInteger(aForm.Components[i].Name, 'Height', TWinControl(aForm.Components[i]).Height); end; end; finally Ini.Free; end; end;
procedure RestoreStateComps(aForm: tCustomForm); var i: Integer; oFName: string; ini: TIniFile; WC: TWinControl; begin oFName := ExtractFilePath(ParamStr(0)); if oFName[Length(oFName)] <> '\' then oFName := oFName + '\'; oFName := oFname + aForm.Name + '.GzFS'; Ini := TIniFile.Create(oFName); try for i := aForm.ComponentCount - 1 downto 0 do begin if aForm.Components[i] is TWinControl then begin TWinControl(aForm.Components[i]).Left := ini.ReadInteger(aForm.Components[i].Name, 'Left', TWinControl(aForm.Components[i]).Left); TWinControl(aForm.Components[i]).Top := ini.ReadInteger(aForm.Components[i].Name, 'Top', TWinControl(aForm.Components[i]).Top); TWinControl(aForm.Components[i]).Width := ini.ReadInteger(aForm.Components[i].Name, 'Width', TWinControl(aForm.Components[i]).Width); TWinControl(aForm.Components[i]).Height := ini.ReadInteger(aForm.Components[i].Name, 'Height', TWinControl(aForm.Components[i]).Height); end; end; finally Ini.Free; end; end; |
conch
31184
|
2007/9/18 15:10:26 |
这个非常好,跟delphi自己的很接近,还是用接口好! |
chang_soft
31179
|
2007/9/18 9:26:01 |
不错奥,支持楼主的说 |
swgame
31178
|
2007/9/18 9:24:35 |
我是直接把 Application.MainFormOnTaskbar := True; 删除掉。 楼主的这个东东确实是挺棒。再结合数据库就可以做支持用户自己设计界面了。 楼主太有才了。 |
wr960204
31177
|
2007/9/18 9:13:39 |
to qh_liyan 你的打开窗口文件的提示是因为我是D2007开发的.而你使用D7打开的.所以有提示. Application.MainFormOnTaskbar := True;也是D2007里面自动生成的.注释掉好了. |
james_
31176
|
2007/9/18 9:07:27 |
厉害哦,支持st52说法 |
qh_liyan
31175
|
2007/9/18 9:01:48 |
相当好,不过为什么我打开的时候,提示invalid resouce file : error reading file error creating form。编译的时候Application.MainFormOnTaskbar := True;未声明? |
hotyei
31174
|
2007/9/18 8:40:50 |
非常不错。 |
st52
31173
|
2007/9/18 8:24:08 |
有个保存状态就更好了`` |
wangyunyong
31172
|
2007/9/18 8:11:14 |
这个东西确实好,谢谢楼主. |
|