B
bcfans
Unregistered / Unconfirmed
GUEST, unregistred user!
★★★发现delphi6有一个毛病!大家都来看一下,我给100分。谢谢
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure button1click(sender:tobject); //自己写上的
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure button(sender:tobject);
begin
case (sender as tbutton).Tag of
0:form1.button2.enabled:=false;
1:form1.button1.enabled:=false;
2:begin
form1.button1.enabled:=true;
form1.button2.enabled:=true;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject); //自己写上的
begin
button(sender);
end;
end.
如果
procedure TForm1.Button1Click(Sender: TObject);
begin
button(sender);
end;
这个过程是自己写的而没有在object inspector中选择button1的onclick事件的话,程序运行时点击button1就没有反应,只有再点击object inspector中button1的onclick事件后才能运行,不知道是怎么回事?我的电邮是:onlydelphi@hotmail.com MSN是:onlydelphi@hotmail.com
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure button1click(sender:tobject); //自己写上的
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure button(sender:tobject);
begin
case (sender as tbutton).Tag of
0:form1.button2.enabled:=false;
1:form1.button1.enabled:=false;
2:begin
form1.button1.enabled:=true;
form1.button2.enabled:=true;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject); //自己写上的
begin
button(sender);
end;
end.
如果
procedure TForm1.Button1Click(Sender: TObject);
begin
button(sender);
end;
这个过程是自己写的而没有在object inspector中选择button1的onclick事件的话,程序运行时点击button1就没有反应,只有再点击object inspector中button1的onclick事件后才能运行,不知道是怎么回事?我的电邮是:onlydelphi@hotmail.com MSN是:onlydelphi@hotmail.com