楼主   用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..........
我看到别人做到了 请哪位大虾赐教  谢谢!  
 

解决方案 »

  1.   

    我看到别人很简单做到了 就用Tstream
      请哪位大虾赐教  谢谢!  
      

  2.   

    注:
    我是用来保存Form上edit框和checkbox的值到一个文件中。
    因为有多个edit 又不想一条一条的太麻烦.
      

  3.   

    好象用Tfiler.DefineProperty()
       procedure DefineProperty(const Name: string;      ReadData: TReaderProc; WriteData: TWriterProc;      HasData: Boolean); virtual; abstract;
    大家知道 readdata,writedata 怎么设吗????????
      

  4.   

    做个递归函数!遍历所有的组件。如果碰到TEdit类型的和tcheckbox类型的就保存他们的txt文件!就这样。很简单。delphi的组件都提供了很方便的管理组件内部的组件。
      

  5.   

    to  jtg98g3(跳舞的青蛙) 
     如何遍历所有的组件啊??