www.pudn.com > Desktop-Manager.rar > Unit3.pas, change:2004-04-29,size:817b


unit Unit3; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, 
  Dialogs, StdCtrls; 
 
type 
  TForm3 = class(TForm) 
    Label1: TLabel; 
    Edit1: TEdit; 
    Button1: TButton; 
    Button2: TButton; 
    procedure Button2Click(Sender: TObject); 
    procedure Button1Click(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Form3: TForm3; 
 
implementation 
uses unit1; 
 
{$R *.dfm} 
 
procedure TForm3.Button2Click(Sender: TObject); 
begin 
  close; 
end; 
 
procedure TForm3.Button1Click(Sender: TObject); 
begin 
  Form1.DataSource1.Edit; 
  //将新名字写如数据库 
  Form1.DataSource1.DataSet.FieldByName('filename').Value:=Edit1.Text; 
  Form1.DataSource1.DataSet.Post; 
  close; 
end; 
 
end.