Recent

Author Topic: [SOLVED]ContextMenu In LAzarus  (Read 298 times)

shonay

  • Full Member
  • ***
  • Posts: 169
[SOLVED]ContextMenu In LAzarus
« on: March 29, 2020, 02:03:02 pm »
How do I go about creating contextmenu strip in Lazarus Pascal? Any Ideas?
« Last Edit: March 29, 2020, 02:52:41 pm by shonay »
When the power of love overcomes the love of power, the world would know Peace

- Jimi Hendrix.

jamie

  • Hero Member
  • *****
  • Posts: 3077
Re: ContextMenu In LAzarus
« Reply #1 on: March 29, 2020, 02:12:59 pm »
There are many ways …..

 Drop a TMainMenu on the form to start with, Right click it to select the editor for it, Add menus etc..

 
 Use a TtoolBar maybe.... etc

 The list goes on...
The only true wisdom is knowing you know nothing

shonay

  • Full Member
  • ***
  • Posts: 169
Re: ContextMenu In LAzarus
« Reply #2 on: March 29, 2020, 02:27:26 pm »
There are many ways …..

 Drop a TMainMenu on the form to start with, Right click it to select the editor for it, Add menus etc..

 
 Use a TtoolBar maybe.... etc

 The list goes on...

Doing it with TmainMenu gave me this

(https://i.postimg.cc/HcL9fnYw/xuum.png)

What i want to accomplish is something like this

I drag TlistView to the form now i want a scenario where I right click on the Tlistview and it shows several menus where one can select from.
When the power of love overcomes the love of power, the world would know Peace

- Jimi Hendrix.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6368
    • wiki
Re: ContextMenu In LAzarus
« Reply #3 on: March 29, 2020, 02:39:27 pm »
You want TPopUpMenu

And then in the listview is a property "PopupMenu" (if not, then its not supported directly. You can still catch the right click, and force it)

howardpc

  • Hero Member
  • *****
  • Posts: 3446
Re: ContextMenu In LAzarus
« Reply #4 on: March 29, 2020, 02:42:14 pm »
As Martin writes: drop a TPopupMenu on your form.
Right click on it to add the items you need.
In the object inspector, find your listview's PopupMenu property and in the dropdown select the popupmenu you created, by default it is PopupMenu1.

shonay

  • Full Member
  • ***
  • Posts: 169
Re: ContextMenu In LAzarus
« Reply #5 on: March 29, 2020, 02:51:07 pm »
TpopUpMenu Did it.

Thank you @Martin_fr
When the power of love overcomes the love of power, the world would know Peace

- Jimi Hendrix.

 

TinyPortal © 2005-2018