Recent

Author Topic: Avoid pop-up on right click  (Read 932 times)

valter.home

  • Jr. Member
  • **
  • Posts: 81
Avoid pop-up on right click
« on: October 01, 2020, 07:51:21 pm »
Hello everybody,
I have a TMemo, when I hold down the left button the text scrolls down, the right button instead scrolls the text up.
However, I have the problem that when I release the right button, the Windows menu appears.
Is there a way to intercept and prevent this menu from appearing?

Handoko

  • Hero Member
  • *****
  • Posts: 5130
  • My goal: build my own game engine using Lazarus
Re: Avoid pop-up on right click
« Reply #1 on: October 01, 2020, 08:04:56 pm »
Add a TPopupMenu then set the Memo.PopupMenu property to the newly created popupmenu. Tested on Linux, it works.

valter.home

  • Jr. Member
  • **
  • Posts: 81
Re: Avoid pop-up on right click
« Reply #2 on: October 01, 2020, 08:11:24 pm »
Quote
Add a TPopupMenu

Great! It also works on Windows, thanks a lot.


Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: Avoid pop-up on right click
« Reply #3 on: October 01, 2020, 10:56:50 pm »
Add OnContextPopup handler and in the event handler set Handled tot True.
This should prevent the popping up of the context menu.

Bart

 

TinyPortal © 2005-2018