Disable right-click menu for RTF2 control from Stephen Lebans

B

Bogdan Zamfir

Hi,

I use RTF2 control in my application, but I need to ovver users only
limited formatting options (B, U, I, background color and lists). So I
Need to disable the right click menu
Is there any way to accomplish this? I saw the control does not expose
any mouse-related events, and I didn't noticed any property which would
do that.

Regards,
Bogdan Zamfir
 
S

Stephen Lebans

Sorry, there is no property exposed to turn off the right click popup menu.
THere is a change event though. You would have to add logic to check what
formatting the user has just added and decide whether to accept it or not.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
B

Bogdan Zamfir

Hi,

Thank you for your answer.
I'd like to ask if source code for the RTF2 ActiveX is available,
because I could add the property myself.

Of, maybe using Win32 API, I can intercept the right-click message sent
to the RTF2 and ignore it?

Can you give me any directions on this?

Thank you

Bogdan Zamfir

PS Do you know when a new version will be available? Maybe you can add
then prop to disable right-click menu, and eventually a right-click
event, to be able to add code for custom popup menu?
 
B

bzamfir

Actually, I found a solution with subclassing. I describe it below, so
others that might need this behaviour could use it

I use a free ActiveX control for subclassing, Subclass - Visual Basic
subclassing control
Copyright (c) 1997 SoftCircuits Programming (R)
(http://www.softcircuits.com)

I subclassed the RTF2 control, intercept the right mouse click, open my
own popup with limited formatting options, and do not pass the message
anymore to RTF control.

Because I use multiple RTF2 controls on the same form, I hook them to
subclass ocx in GotFocus and unkooh in LostFocus

Regards,
Bogdan Zamfir
 
S

Stephen Lebans

Bogdan why don't you create a small sample MDB demonstrating your solution
that I could post on the RTF2 Web page.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
S

Stephen Lebans

I am making the source code available to a German developer to
internationalize the Menus and to add any updates/mods he wants to include.
I will no longer be updating the control as Office 12 will included a fully
integrated RTF/HTML control that natively supports CanGrow/Shrink.

I produced the control in VC++ 6.0.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
B

Bogdan Zamfir

Hi,

I will make it, and send it to you.
If I'll have time, I'll try to implement it with direct Win32API,
without ActiveX control (although, I saw the Subclassing ActiveX seems
reliable)

Regards,
Bogdan
 
S

Stephen Lebans

Due to a bug in the VB IDE you must place your subclassing code within an
external DLL. Just use the ActiveX control for simplicity sake.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top