我想在Edit1中输入RadioButton1的名称,
用了语句:"form5.RadioButton1.Caption:=Edit1.text;"
但在关闭程序后,RadioButton1的名称又变为原来的名称,我希望在关闭程序时名称仍是Edit1中输入的值,
不知该怎样写?我还想问个问题,就是adoquery有没有函数可以一次删除一张表中所有的数据?请大家帮帮忙,谢谢!

解决方案 »

  1.   

    我希望在关闭程序时名称仍是Edit1中输入的值,
    不知该怎样写?
    上面的不明白什么意思。。是要关闭后再次打开程序的时候,里面还是你上次设定的数值吗?我还想问个问题,就是adoquery有没有函数可以一次删除一张表中所有的数据?
    回答如下
    with adoquery1 do
    begin
      close;
      sql.clear;
       sql.add('delete from tablename');
      execsql.
    end;
      

  2.   

    直接更改RadioButton1.Caption是很麻烦.你还不如用1张数据表来管理RadioButton1.Caption的值,当调用form5时,从数据表中获取,然后赋给RadioButton1,当更改了EDIT后,写入数据表.
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs,inifiles, StdCtrls;//这里加上inifilestype
      TForm1 = class(TForm)
        RadioButton1: TRadioButton;
        Edit1: TEdit;
        Button1: TButton;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
        procedure FormClose(Sender: TObject; var Action: TCloseAction);
      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('c:\dd.ini');//在c盘建立配置文件dd.ini
      RadioButton1.Caption := inifile.ReadString('editconfig','radiobtncaption','');
      inifile.Free;end;procedure TForm1.Button1Click(Sender: TObject);
    begin
       RadioButton1.Caption := Edit1.Text;
    end;procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
    var
      inifile : TIniFile;
    begin
      inifile := TIniFile.Create('c:\dd.ini');//关闭的时候把文件更新
      inifile.WriteString('editconfig','radiobtncaption',RadioButton1.Caption);
      inifile.Free;end;end.
      

  4.   

    学习
    wudi1982还是比较牛要是我就只会写配置文件了:(
      

  5.   

    yy  2006 下 type  
      TEditHelper = class helper for TEdit
        class var 
          Textheper ;String;
      end;
    ----