本来我想在(actions[1] as taction)的后面取enable属性的(如下代码样就行了),但是却怎么也取不到enable属性,输入'e'进去只能取到execute开头的属性,不解!?,不知为何,在线急待procedure Tlandingfrm.FormHide(Sender: TObject);
var
astr:string;
begin
astr:=mindatamodule.adolog.FieldValues['permit'];
begin
with mainpagefrm.ActionList1 do
begin
if astr[1]:='1' then
(actions[1] as taction).enable:=true
else
(actions[1] as taction).enable:=true;
if astr[2]:='1' then
(actions[2] as taction).enable:=true
else
(actions[2] as taction).enable:=true;
....
end;
end;
var
astr:string;
begin
astr:=mindatamodule.adolog.FieldValues['permit'];
begin
with mainpagefrm.ActionList1 do
begin
if astr[1]:='1' then
(actions[1] as taction).enable:=true
else
(actions[1] as taction).enable:=true;
if astr[2]:='1' then
(actions[2] as taction).enable:=true
else
(actions[2] as taction).enable:=true;
....
end;
end;
我这里测试都是正确的。
begin
with mindatamodule.adolog do
begin
close;
sql.Clear;
sql.Add('select permit from tuser where login='+char(39)+landingfrm.landedt1.Text+char(39));
open;
astr:=mindatamodule.adolog.FieldValues['permit'];
if astr[3]='1' then
(actionlist1.Actions[1] as taction).Enabled:=true
else
(actionlist1.Actions[1] as taction).Enabled:=false;
if astr[2]='1' then
(actionlist1.Actions[2] as taction).Enabled:=true
else
(actionlist1.Actions[3] as taction).Enabled:=false;
......