I know that FormLib.dll has a contextmenu in it,
But this is short and neat and may be of interest to someone.
mini.New1("?")
'?' is any object in your app. Form1, Label1, Textbox1 etc.
The contextmenu has 3 items in it.
The default text for the items can be read or changed by
the relevant mini.Item'x'text method.
sub mini_PopUp is fired before the menu is displayed,
but after the menu has been initiated, 'right click or
stylus touch on the 'control' defined in the New1("?")
Hence the use of the timer1 in the Sub mini_PopUp
If a menu item is not clicked,
mini.RespText returns the string "null"
mini.RespValue returns the int 0
If the menu is clicked,
mini.RespText returns the 'preset' or 'set' text for the Item
mini.RespValue returns the 'preset' Int for item, 1 - 3.
Ive added the .dll, .sbp source example and the Class1.cs C# file.
@whoever knows, how do I get the MenuItem.Click event to work
But this is short and neat and may be of interest to someone.
mini.New1("?")
'?' is any object in your app. Form1, Label1, Textbox1 etc.
The contextmenu has 3 items in it.
The default text for the items can be read or changed by
the relevant mini.Item'x'text method.
sub mini_PopUp is fired before the menu is displayed,
but after the menu has been initiated, 'right click or
stylus touch on the 'control' defined in the New1("?")
Hence the use of the timer1 in the Sub mini_PopUp
If a menu item is not clicked,
mini.RespText returns the string "null"
mini.RespValue returns the int 0
If the menu is clicked,
mini.RespText returns the 'preset' or 'set' text for the Item
mini.RespValue returns the 'preset' Int for item, 1 - 3.
B4X:
Sub Globals
'Declare the global variables here.
End Sub
Sub App_Start
Form1.Show
mini.New1("Form1")
End Sub
Sub mini_PopUp
timer1.Interval=2000
timer1.Enabled=True
End Sub
Sub Timer1_Tick
timer1.Enabled=False
Msgbox(mini.RespText,mini.RespValue)
End Sub
Ive added the .dll, .sbp source example and the Class1.cs C# file.
@whoever knows, how do I get the MenuItem.Click event to work
Attachments
Last edited: