tremara1 Active Member Licensed User Longtime User Feb 17, 2017 #1 I have searched high and low for the syntax for for callin a button click event. I still cannot find the correct way to do this. The button event is btnAdd_MouseClicked (EventData As MouseEvent) I want to call this from a menu item. I have tried and tried but cannot seem to the syntax right to fire the button click event. Anyone help??? Thanks
I have searched high and low for the syntax for for callin a button click event. I still cannot find the correct way to do this. The button event is btnAdd_MouseClicked (EventData As MouseEvent) I want to call this from a menu item. I have tried and tried but cannot seem to the syntax right to fire the button click event. Anyone help??? Thanks
tremara1 Active Member Licensed User Longtime User Feb 18, 2017 #2 Sorry I should have inquired as to if you can do this in B4J......... Upvote 0
klaus Expert Licensed User Longtime User Feb 18, 2017 #3 If you don't need any values from EventData, use btnAdd_Action insted of btnAdd_MouseClicked (EventData As MouseEvent). Or you can do it that way: Define a routine with the code, and call it from MouseClicked or from the menu. Code: Copy Sub btnAdd_MouseClicked (EventData As MouseEvent) MyRoutine End Sub ' ' Sub MyRoutine 'your code End Sub Otherwise you would need to define a MouseEvent object with JavaObject to satisfy the signature of the MouseClicked event routine. Upvote 0
If you don't need any values from EventData, use btnAdd_Action insted of btnAdd_MouseClicked (EventData As MouseEvent). Or you can do it that way: Define a routine with the code, and call it from MouseClicked or from the menu. Code: Copy Sub btnAdd_MouseClicked (EventData As MouseEvent) MyRoutine End Sub ' ' Sub MyRoutine 'your code End Sub Otherwise you would need to define a MouseEvent object with JavaObject to satisfy the signature of the MouseClicked event routine.
tremara1 Active Member Licensed User Longtime User Feb 18, 2017 #4 Thanks Klaus I did that workaround ...I will also try the btn_Action..... Upvote 0
tremara1 Active Member Licensed User Longtime User Feb 18, 2017 #5 Both answers worked, good job thanks...... Upvote 0