![]() |
QUESTION: Disable ContextMenu on string items |
Post Reply ![]() |
Author | |
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() Posted: 14 April 2009 at 10:17am |
Hi,
Is there a way to disable contextmenu when right clicking string item? Any help would be appreciated
![]() Thanks a lot in advance
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
The only method I found was to subclass the WM_CONTEXTMENU message of the EditHwnd during the RequestEdit event. I think CJ will have to add a property to make this easier, unless I missed something.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi Jason,
Thanks for reply. If I would subclass the WM_CONTEXTMENU message, would it be possible to change the captions of buttons (Copy,Paste etc etc)?
I'm asking this because I need to change application language during runtime. All works OK except for rightclicking a property string and SystemMenu (I was hoping on Oleg 's reply in some CommandBars subforum
![]() Thanks a lot
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Hi Aaron,
You can create a completely custom menu using the CommandBars control (for example) and show that in place of the default context menu. I've put together a sample app here: uploads/20090415_110906_SubclassPropert.zip Using this method, showing just about any kind of context menu should be possible. The unfortunate side-effect is subclassing in the IDE is no fun, but there are safe-subclassing libraries out there you can use to make life easier. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi Jason,
Thanks a lot for sample project
![]() I hope you are using it
![]() Thank you
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Hi Aaron, the code is "safe" in the sense that it will work perfectly in your compiled EXE. It is "unsafe" in the sense that you can't break your program execution in the IDE to debug while the subclasser is active (when the edit window is visible), because it will crash the VB6 IDE. There are subclassing DLLs out there that prevent this problem, but then you add a dependency to your distribution. In any case, a CJ alternative (such as a UseDefaultContextMenu property) would be ideal.
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi Jason,
I know the "downside" of subclassing, that's why I minimize the use...
![]() I really want to make this work so I can select different languages during runtime.
Maybe CJ will take care of this and create property for ContextMenu, would be nice option to have
![]() btw I also tried your code with wndReportControl.InplaceEditHwnd but this doesn't work as with PropertyGrid control ?!?
Thanks again
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Will this be possible in future release / ever?
Thank you
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
|
JantjeKeizer ![]() Groupie ![]() Joined: 12 February 2008 Status: Offline Points: 70 |
![]() ![]() ![]() ![]() ![]() |
You can use this for IDE safe subclassing
|
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Sorry Aaron, I missed the part of your post that said it doesn't work with the ReportControl...I'll take a look and see if I can get it working. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
jpbro ![]() Senior Member ![]() ![]() Joined: 12 January 2007 Status: Offline Points: 1355 |
![]() ![]() ![]() ![]() ![]() |
Try this:
Seems to work here. |
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi Jason,
Thanks for checking this
![]() Thanks again.
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |