rwblinn Well-Known Member Licensed User Longtime User Aug 24, 2014 #1 Hi, looking for an easier way to define actions and assign these directly to menu_action and button_action instead of defining subs for each control using the same action. It is basically an Actionlist (like used in Lazarus, Delphi). Example Current Coding Code: Copy Sub About_Action Log("About...") End Sub Sub mnuAbout_Action About_Action End Sub Sub btnAbout_Action About_Action End Sub Suggestion Code: Copy Private mnuAbout As MenuItem = mnuAbout.Action = About_Action Private btnAbout As Button = btnAbout.Action = About_Action
Hi, looking for an easier way to define actions and assign these directly to menu_action and button_action instead of defining subs for each control using the same action. It is basically an Actionlist (like used in Lazarus, Delphi). Example Current Coding Code: Copy Sub About_Action Log("About...") End Sub Sub mnuAbout_Action About_Action End Sub Sub btnAbout_Action About_Action End Sub Suggestion Code: Copy Private mnuAbout As MenuItem = mnuAbout.Action = About_Action Private btnAbout As Button = btnAbout.Action = About_Action
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2014 #2 You can set the id of these nodes to the same value.
rwblinn Well-Known Member Licensed User Longtime User Aug 27, 2014 #3 Thx Erel for the hint, which was my initial thought as well. The disadvantage of using a single ID, is that the properties of various controls using the action, can not be set individually.
Thx Erel for the hint, which was my initial thought as well. The disadvantage of using a single ID, is that the properties of various controls using the action, can not be set individually.