PC Review


Reply
Thread Tools Rate Thread

Context Menus

 
 
Nikos
Guest
Posts: n/a
 
      25th Mar 2010
Is it possible to show different context menus by right clicking
on different areas of a picturebox f.e. ?

An option is to build all the menus as subitems of the the main
context menu and hide/unhide them with the visible method.
Is there an other option on doing this?

Thanks in advance,
/\/ikos
 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      25th Mar 2010
Am 25.03.2010 09:11, schrieb Nikos:
> Is it possible to show different context menus by right clicking
> on different areas of a picturebox f.e. ?
>
> An option is to build all the menus as subitems of the the main
> context menu and hide/unhide them with the visible method.
> Is there an other option on doing this?


ContextMenu or ContextMenuStrip?

With ContextMenuStrip: Handle it's opening event:

Private Sub ContextMenuStrip1_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) _
Handles ContextMenuStrip1.Opening

Dim p = DirectCast(sender, ContextMenuStrip).SourceControl.PointToClient(Cursor.Position)

'Modify the ContextMenu here depending on p.

End Sub

Maybe there's already property in the ContextMenuStrip that reveals the position inside
the SourceControl, but I couldn't find it.


--
Armin
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Context Menus JamesJ Microsoft Access Forms 2 17th Jun 2008 10:44 PM
WPF context menus hbrower Microsoft Dot NET Framework 1 28th Feb 2008 02:14 AM
Context Menus Wayne Microsoft Windows 2000 Group Policy 3 8th Apr 2005 09:39 PM
Context Menus Peter Swan Microsoft Outlook Program Addins 1 6th Aug 2004 12:48 PM
Context menus and treeviews, suggestions for a NODE sensitive context menu Eric Newton Microsoft Dot NET Framework Forms 4 13th Jan 2004 09:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:29 PM.