我照书上超UseRightToLeftAlignment的方法
nit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
PopupMenu1: TPopupMenu;
N1111: TMenuItem;
private
{ Private declarations } public
{ Public declarations } end;var
Form1: TForm1;
implementation{$R *.dfm}function TPopupMenu.UseRightToLeftAlignment:Boolean; //这里说 function needs result type
var
AControl:TControl;
begin
Result:=false;
if not SysLocale.MiddleEast then Exit;
if FParetBiDiMode then
begin
AControl:=FindPopipControl(FPopupPoint);
if AControl <> nil then
Result:=AControl.UseRightToLeftAlignment
else
Result:=(FBiDiMode = bdRightTolEFT);
end;
end.
这段书上的意思是 useRightToLeftAlignMent是一个Protected级别的方法,实例对象无法直接访问该方法,
但是从TPOPupMenu继承巍峨来的新类中能够访问该方法
nit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
PopupMenu1: TPopupMenu;
N1111: TMenuItem;
private
{ Private declarations } public
{ Public declarations } end;var
Form1: TForm1;
implementation{$R *.dfm}function TPopupMenu.UseRightToLeftAlignment:Boolean; //这里说 function needs result type
var
AControl:TControl;
begin
Result:=false;
if not SysLocale.MiddleEast then Exit;
if FParetBiDiMode then
begin
AControl:=FindPopipControl(FPopupPoint);
if AControl <> nil then
Result:=AControl.UseRightToLeftAlignment
else
Result:=(FBiDiMode = bdRightTolEFT);
end;
end.
这段书上的意思是 useRightToLeftAlignMent是一个Protected级别的方法,实例对象无法直接访问该方法,
但是从TPOPupMenu继承巍峨来的新类中能够访问该方法
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货