请考虑这个简化的示例:
type
TForm43 = class(TForm)
drwgrd1: TDrawGrid;
procedure drwgrd1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: Windows.TRect; State: TGridDrawState);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure TForm43.drwgrd1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: Windows.TRect; State: TGridDrawState);
begin
Rect.Left := 5;
end;
在方法 drwgrd1DrawCell
中,我明确使用 Windows.TRect
来解决在两个不同单元中定义的 TRect
之间的歧义。一切正常,代码正在编译。
但是每次当我保存上述单元时,我都会从 Delphi IDE 收到一个问题,询问:“drwgrd1.OnDrawCell 引用的 drwgrd1DrawCell 方法有一个不兼容的参数列表。删除引用?”
这很烦人。有什么方法可以关闭此消息对话框或以不显示该消息的方式编写我的代码吗?不幸的是,我无法将我的 TRect
更改为 TRect2
或类似的东西。
最佳答案
您可以在表单声明上方添加以下类型声明:
type
TRect = Windows.TRect;
关于delphi - Delphi IDE 中的 "incompatible parameter list"消息是否有解决方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12624306/