DoubleBuffered has been in TWinControl for some time now. The difference in Delphi 2009 is that it is published now. If you can only live by ignoring errors (and instead of using properties instead), this is a possible solution:
unit Delphi2009Form; interface uses Windows, Classes, SysUtils, Controls, Forms; type {$IFDEF VER200} TDelphi2009Form = class(TForm); {$ELSE} TDelphi2009Form = class(TForm) private procedure ReaderError(Reader: TReader; const Message: string; var Handled: Boolean); protected procedure ReadState(Reader: TReader); override; end; TReaderErrorProc = procedure(const Message: string); var ReaderErrorProc: TReaderErrorProc = nil; {$ENDIF} implementation {$IFNDEF VER200} type THackReader = class(TReader); procedure TDelphi2009Form.ReaderError(Reader: TReader; const Message: string; var Handled: Boolean); begin with THackReader(Reader) do Handled := AnsiSameText(PropName, 'DoubleBuffered') or AnsiSameText(PropName, 'ParentDoubleBuffered'); if Handled and Assigned(ReaderErrorProc) then ReaderErrorProc(Message); end; procedure TDelphi2009Form.ReadState(Reader: TReader); begin Reader.OnError := ReaderError; inherited ReadState(Reader); end; {$ENDIF} end.
Then change the form declarations in your project to inherit from TDelphi2009Form, for example:
type TFormMain = class(TDelphi2009Form) ...
This will work at runtime - property errors will be ignored. To make it work during development, create only the design package, add designide.dcp to its require clause, and add the following block to it:
unit Delphi2009FormReg; interface uses Delphi2009Form; procedure Register; implementation uses DesignIntf, DesignEditors, ToolsAPI; procedure ShowReaderError(const Message: string); begin with BorlandIDEServices as IOTAMessageServices do AddTitleMessage(Message); end; procedure Register; begin RegisterCustomModule(TDelphi2009Form, TCustomModule); ReaderErrorProc := ShowReaderError; end; initialization finalization ReaderErrorProc := nil; end.
Install the package in the Delphi 2007 IDE and property errors for the DoubleBuffered and ParentDoubleBuffered properties will be automatically ignored when opening forms in the IDE. Property values ββwill be lost when you save the form in Delphi 2007, so you must initialize them instead of code.
EDIT : I added code to display reader error messages in the IDE message box:

Ondrej Kelle
source share