ActionManager系列控件的一个使用技巧!(给未解决这个问题的朋友们)(0分)

F

Fairys

Unregistered / Unconfirmed
GUEST, unregistred user!
在大富翁中找不到这个控件的详细使用方法,所以花了点时间研究了一下,
以下是将菜单中的Actions项设为禁用和取得它们的CAPTION的例子,请会的
老鸟不要PK我!;)
procedure TForm1.Button4Click(Sender: TObject);
var
I,J:Integer;
begin
J := ActionManager1.ActionCount;
for I:=0 to J-1 do
begin
ListBox1.Items.Add(TCustomAction(ActionManager1.Actions).Caption);
if TCustomAction(ActionManager1.Actions).Caption = '&Close' then
TCustomAction(ActionManager1.Actions).Enabled := False;
end;
end;
 
顶部