用Tstream 保存form问题

terrytzq 2005-01-05 03:17:56
楼主

用Tstream 保存form时,如何只保存组件名称和值?
如:
form 上有edit1.txt:='txt';..............
用tstream.component 保存的文件为
TPF0TForm1Form1Left Top Width?Height?
ActiveControlButton1CaptionForm1Color clBtnFace Font.CharsetDEFAULT_CHARSET
Font.Color clWindowText Font.Height?Font.Name
MS Sans Serif
Font.Style OldCreateOrderVisible
PixelsPerInch`
TextHeight
TEditEdit1Left Top`WidthyHeightTabOrder Text
1234566676 TEditEdit2Left Top WidthyHeightTabOrderText 21234566676 TEditEdit3Left Top WidthyHeightTabOrderTextEdit3 TEditEdit4Left Top WidthyHeightTabOrderTextEdit4 TEditEdit5Left Top WidthyHeightTabOrderTextEdit5 TEditEdit6Left Top WidthyHeightTabOrderTextEdit6 TCheckBox CheckBox1LeftxTop`WidthaHeightCaption CheckBox1TabOrder TCheckBox CheckBox2LeftxTop WidthaHeightCaption CheckBox2TabOrder TCheckBox CheckBox3LeftxTop WidthaHeightCaption CheckBox3TabOrder TCheckBox CheckBox4LeftxTop WidthaHeightCaption CheckBox4TabOrder TCheckBox CheckBox5LeftxTop WidthaHeightCaption CheckBox5TabOrder
TCheckBox CheckBox6LeftxTop(WidthaHeightCaption CheckBox6TabOrder TButtonButton1Left TopWidthKHeightCaptionwriteTabOrder OnClick Button1Click TButtonButton2Left8TopWidthKHeightCaptionreadTabOrder
OnClick Button2Click


我只需保存为如下
TPF0edit1 txt edit2 txt2..........
我看到别人做到了 请哪位大虾赐教 谢谢!


...全文
180 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
terrytzq 2005-01-06
  • 打赏
  • 举报
回复
有没没人啊?》
terrytzq 2005-01-06
  • 打赏
  • 举报
回复
有没没人啊?》
terrytzq 2005-01-06
  • 打赏
  • 举报
回复
好象用Tfiler.DefineProperty()
procedure DefineProperty(const Name: string;

ReadData: TReaderProc; WriteData: TWriterProc;

HasData: Boolean); virtual; abstract;
大家知道 readdata,writedata 怎么设吗????????
cdsgajxlp 2005-01-06
  • 打赏
  • 举报
回复
高难度
terrytzq 2005-01-06
  • 打赏
  • 举报
回复
to jtg98g3(跳舞的青蛙)
如何遍历所有的组件啊??
jtg98g3 2005-01-06
  • 打赏
  • 举报
回复
做个递归函数!遍历所有的组件。如果碰到TEdit类型的和tcheckbox类型的就保存他们的txt文件!

就这样。很简单。delphi的组件都提供了很方便的管理组件内部的组件。

terrytzq 2005-01-05
  • 打赏
  • 举报
回复
有没没人啊?》
terrytzq 2005-01-05
  • 打赏
  • 举报
回复
注:
我是用来保存Form上edit框和checkbox的值到一个文件中。
因为有多个edit 又不想一条一条的太麻烦.
terrytzq 2005-01-05
  • 打赏
  • 举报
回复
我看到别人很简单做到了 就用Tstream


请哪位大虾赐教 谢谢!
caiso 2005-01-05
  • 打赏
  • 举报
回复
顶一下

5,939

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧