修改d7版本的旧系统时,当前正在修改窗体的事件“声明”突然全部丢失了,如://-----------------------
unit Unit1;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
 showmessage('Hello');
end;end.//-------------------------------------突然窗体中控件的声明全部丢失,如这句:
procedure Button1Click(Sender: TObject);
并已保存,无法恢复,再点击窗体上的控件事件时,又重新生成一个空的事件过程,
如新生成:
procedure TForm1.Button1Click(Sender: TObject);
beginend;不能自动定位到原来的事件过程中,怎么办?

解决方案 »

  1.   

    自己再手动添加事件过程的声明时到private前一行时,点击保存,声明也自动丢失,怎么办?
      

  2.   

    delPhi有这么一个功能:如果你的事件是空的,即begin和end之间没有东西,那它会自动帮你删掉。若你想不被删除,在begin和end之间加空注释,即//就行了
      

  3.   

    在type中手动加上procedure xxxxxxxxx(Sender: TObject);并把自动重新生成的空的事件过程删除或者使用备份
      

  4.   

    你杯具了,这样源代码都丢失了啊。
    修改代码前,一定先提交之前的代码到版本控制软件中嘛。另外高版本delphi有个history,一定程度上可以缓解错误修改带来的损失。