Why does the code below return TRUE in Delphi 7 and FALSE in Delphi 2010? TBitBtn is a descendant of 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;