Prev: compiled on visual studio 2003 on windows XP, want to install on windows 7, error
Next: Insert Record in DataContext without upgrading the database
From: Nikos on 25 Mar 2010 04:11 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
From: Armin Zingler on 25 Mar 2010 08:08
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 |