TAction Actions有 01,02,03,....每个里面都有Execute事件。
怎么样通过参数方式调用Execute事件?
比如传进来01,就调用01Execute事件。不是通过赋值方式。(if ss=01 then 01Execute ; if ss=02........这个方法大家都会^-^)
有没有简便的办法?
TMainMenu(FindComponent('MainMenu')).Items[ii].Items[jj].OnClick =具体的事件??
怎么样通过参数方式调用Execute事件?
比如传进来01,就调用01Execute事件。不是通过赋值方式。(if ss=01 then 01Execute ; if ss=02........这个方法大家都会^-^)
有没有简便的办法?
TMainMenu(FindComponent('MainMenu')).Items[ii].Items[jj].OnClick =具体的事件??
TAction(FindComponent('Action'+IntToStr(菜单.Tag))).Execute然后每个菜单的tag数据定义上值;
在创建菜单的时候就把菜单的onlick事件定义好。
TAction(FindComponent('Action'+IntToStr(1))).Execute ;
”
这个写法成立吗?
我的问题是怎么样给OnClick所需的事件。事件是action里的execute事件。
只是给onclick事件赋值,在点菜单的时候才起效。
TAction(FindComponent('Action'+IntToStr(1))).OnExecute ;
搞定。
给大家散分,快点顶,5点结帐
TMainMenu(FindComponent('MainMenu')).Items[ii].Items[jj].action:=
TAction(FindComponent('Action'+IntToStr(1)))这样action的设置对memu也有效啊,action.enable := false memu也一样不能用了