Bonjour :),
Is it possible to have an example of a popupmenu and a mainmenu. Thank you.
Example of PopupMenu and MainMenu
Example of PopupMenu and MainMenu
Hi!
This is for you:
[code]
` menu_and_popupmenu_test by PaPi
object myform as form
object fomenu as mainmenu
object menu1 as menuitem
AutoCheck=True
Caption="menu_1"
object menu3 as menuitem
Caption="menu_3"
onclick=menuclick3
end object
object menu4 as menuitem
Caption="menu_4"
onclick=menuclick4
end object
end object
object menu2 as menuitem
AutoCheck=True
Caption="menu_2"
onclick=menuclick2
end object
end object `fomenu
object m as popupmenu
object s as menuitem
caption="sub1"
onclick=clicked
end object
object s2 as menuitem
caption="sub2"
object s3 as menuitem
caption="subsub3"
onclick=clicked
end object
end object
end object
end object` myform
myform.showmodal
sub menuclick2(sender as menuitem)
if sender=menu2 then showmessage "menu2 clicked"
end sub
sub menuclick3(sender as menuitem)
if sender=menu2 then showmessage "menu3 clicked"
end sub
sub menuclick4(sender as menuitem)
if sender=menu2 then showmessage "menu4 clicked"
end sub
sub clicked(sender as menuitem)
showmessage sender.caption+" clicked"
end sub
[/code]
best regards
PaPi
This is for you:
[code]
` menu_and_popupmenu_test by PaPi
object myform as form
object fomenu as mainmenu
object menu1 as menuitem
AutoCheck=True
Caption="menu_1"
object menu3 as menuitem
Caption="menu_3"
onclick=menuclick3
end object
object menu4 as menuitem
Caption="menu_4"
onclick=menuclick4
end object
end object
object menu2 as menuitem
AutoCheck=True
Caption="menu_2"
onclick=menuclick2
end object
end object `fomenu
object m as popupmenu
object s as menuitem
caption="sub1"
onclick=clicked
end object
object s2 as menuitem
caption="sub2"
object s3 as menuitem
caption="subsub3"
onclick=clicked
end object
end object
end object
end object` myform
myform.showmodal
sub menuclick2(sender as menuitem)
if sender=menu2 then showmessage "menu2 clicked"
end sub
sub menuclick3(sender as menuitem)
if sender=menu2 then showmessage "menu3 clicked"
end sub
sub menuclick4(sender as menuitem)
if sender=menu2 then showmessage "menu4 clicked"
end sub
sub clicked(sender as menuitem)
showmessage sender.caption+" clicked"
end sub
[/code]
best regards
PaPi
Example of PopupMenu and MainMenu
Very simple, Thank you very much :)