【发布时间】:2010-04-21 11:53:25
【问题描述】:
当我尝试运行自己的项目时,有时会收到错误消息:EReadError 并显示消息“Property PageNr 不存在”。我真的很绝望,因为我根本看不出是什么原因。可怕的是它有时但经常出现。它涉及我自己的组件 TPage。这是声明>
TPage = class(TCustomControl) //
private
FPaperHeight, FPaperWidth:Integer;
FPaperBrush:TBrush;
FPaperSize:TPaperSize;
FPaperOrientation:TPaperOrientation;
FPDFDocument: TPDFDocument;
FPageNr:integer;
procedure PaintBasicLayout;
procedure PaintInterior;
procedure SetPapersize(Value: TPapersize);
procedure SetPaperHeight(Value: Integer);
procedure SetPaperWidth(Value: Integer);
procedure SetPaperOrientation(value:TPaperOrientation);
procedure SetPaperBrush(Value:TBrush);
procedure SetPageNr(Value:Integer);
protected
procedure CreateParams(var Params:TCreateParams); override;
procedure AdjustClientRect(var Rect: TRect); override;
public
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
// function GetChildOwner:TComponent; override;
procedure DrawControl(X,Y :integer; Dx,Dy:Double; Ctrl:TControl;NewCanvas:TCanvas);
// procedure GetChildren(Proc:TGetChildProc; Root:TComponent); override;
procedure Loaded; override;
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
procedure Paint; override;
procedure PrintOnCanvas(X,Y:integer; rX,rY:Double; ACanvas:TCanvas);
procedure PrintOnPDFCanvas(X,Y:integer);
procedure PrintOnPrinterCanvas(X,Y:integer);
procedure Resize; override;
procedure SetPrintKind(APrintKind:TPrintKind; APrintGroupindex:Integer);
published
property PageNr:integer read FPageNr write SetPageNr;
property PaperBrush: TBrush read FPaperBrush write SetPaperBrush;
property PaperHeight: integer read FPaperHeight write SetPaperHeight;
property PaperWidth: integer read FPaperWidth write SetPaperWidth;
property PaperSize: TPaperSize read FPaperSize write SetPaperSize;
property PaperOrientation:TPaperOrientation read FPaperOrientation write SetPaperOrientation;
property PDFDocument:TPDFDocument read FPDFDocument write FPDFDocument;
property TabOrder;
end;
我彻底阅读了此处描述的类似主题:
Delphi: EReadError with message 'Property Persistence does Not exist'
但这里是我自己的源代码。没有第三方。有趣的是:当我在我的 dfm 文件(unit1.dfm)中删除 PageNr 属性时,会弹出:EReadError 并带有消息“Property PaperHeight 不存在”。当我删除 PaperHeight 然后它会要求 PaperWidth 等等......
这是一段 dfm 文件:
object pg1: TPage
Left = 128
Top = 144
Width = 798
Height = 1127
PageNr = 0
PaperHeight = 1123
PaperWidth = 794
PaperSize = psA4
PaperOrientation = poPortrait
TabOrder = 0
object bscshp4: TBasicShape
Left = 112
Top = 64
Width = 105
Height = 105
PrintKind = pkNormal
PrintGroupIndex = 0
Zooming = 100
Transparent = False
Repeating = False
PageRepeatOffset = 1
ShapeStyle = ssVertical
LinePosition = 2
end
object bscshp5: TBasicShape
Left = 288
Top = 24
Width = 105
Height = 105
PrintKind = pkNormal
PrintGroupIndex = 0
Zooming = 100
Transparent = False
到底发生了什么???????我从来没有见过。我多次编译单元...遇到没有问题。也许原因不止于此。我感到完全无能为力。
【问题讨论】:
-
TPage 不会与您系统上安装的现有组件发生冲突吗?
标签: delphi