为什么以下代码在Delphi 7中返回TRUE而在Delphi 2010中返回FALSE? TBitBtn是TButton的后裔。
type
TForm1 = class(TForm)
Button1: TButton;
BitBtn1: TBitBtn;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TestControl( aControl: TControl);
begin
if (aControl is TButton) then showmessage('TRUE') else showmessage('FALSE');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TestControl(BitBtn1);
end;