Disable mouse right click option on Rich Text Control

Discussion forum about all things Gupta, OpenText and the community.
Viswanadha
India
Posts: 23
Joined: 12 Jul 2018, 10:24
Location: Chennai, India

Disable mouse right click option on Rich Text Control

Post by Viswanadha » 12 Feb 2020, 12:25

Hello,

Can you anyone suggest how to disable mouse right click when they clicked on Rich Tex Control. My business scenario is to display data from a COM object and not allow to edit. I am able to do this by changing Read-only option to yes. But the user able to see pop up menu when they right click on the control RCT.

1. Is there any way to disable mouse right click or avoid displaying pop up menu.
2. Ctrl+tab is allowing to focus on next control available in the form when but user want to focus to next control when clicks on TAB button

Thanks in Advance.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: Disable mouse right click option on Rich Text Control

Post by Dave Rabelink » 12 Feb 2020, 15:18

For both requirements:

Code: Select all

Rich Text Control: rtfDisplay
	Message Actions
		On SAM_Create
			!
			! Option: disable the control to get rid of tabbing to it and having no popup menu. When disable is not wanted, see other messages below 
			! Call SalDisableWindow( hWndItem )
		On SAM_ContextMenu
			! Do not show right mouse popup menu
			Return FALSE
		On WM_NEXTDLGCTL
			! Post message to form to force the focus on the next control
			Call SalPostMsg( hWndForm, WM_NEXTDLGCTL, wParam, lParam )

See attachment. TD 6.1 file format

RichEditControl_TabToNextField.zip
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Viswanadha
India
Posts: 23
Joined: 12 Jul 2018, 10:24
Location: Chennai, India

Re: Disable mouse right click option on Rich Text Control

Post by Viswanadha » 13 Feb 2020, 14:03

Thanks Dave for sharing code snippet. It's working. You made my day. It really helped me a lot.

Kindly suggest any guide/pdf to learn more about user32.dll functions.

Thanks
Viswa

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests