OK so I am trying to add a Right Click Context Menu to my Custom Tree Node. I can get the menu item to appear in the context menu but when I try and execute it nothing happens. I have noticed this with other C# Events where there is a similar "Func" Value. So for SDBMenuItem there is an OnClick event and an OnClickFunc property for Script assignment.
Thanks for responding. I think you helped me figure it out. So the OnClick is the old version and isn't meant to be used in C#. However everything is based on using Scripts and not using straight code. So it appears I have to mix a combination of the two. I do all the work in the C# code however I register the OnClick code in the VBS script and just call my C# code when the menu item is pressed. So here is my VBS code...
' Declare all variables
Dim application
Dim mnuViewLog
' Called for all Auto-Scripts when MM starts
Sub OnStartup
Set application= CreateObject("Melloware.MyApp")
application.Init(SDB)
' get the menu object created in the C# code and assign OnClick
Set mnuViewLog = SDB.Objects("mnuViewLog")
Script.RegisterEvent mnuViewLog, "OnClick", "OnViewLogClick"
End Sub
' Event when View Log menu item is clicked
Sub OnViewLogClick( Item)
' use this like a callback and call this method in the C# code when menu item is clicked
application.MenuViewLogFile_OnClick()
End Sub