+ Reply to Thread
Results 1 to 2 of 2

Thread: SHow Context Menu on MenuItem Right click

  1. #1
    mansi sharma is offline VB.NET Forum Newbie mansi sharma is on a distinguished programming path ahead
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Mar 2009
    Age
    28
    Posts
    16
    Reputation
    21

    Default MenuItem + ContextMenu

    I want to show the contextMenu on MenuItem right click....AS IE favorites....
    I m able to show the contextMenu when i right click on menu..But the Probs is dat when i right click..Context menu is showing & menu is hidding.......
    Y so ..I want that when we right clikc on menu..Menu is not hidden..How to do dat..

    Code:
      Private Sub MenuAddToFavorites_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MenuAddToFavorites.MouseDown
            If e.Button = Windows.Forms.MouseButtons.Right Then
                ContextMenuFavorites.Show(DirectCast(sender, ToolStripMenuItem).GetCurrentParent.PointToScreen(e.Location))
            End If
        End Sub

  2. #2
    mansi sharma is offline VB.NET Forum Newbie mansi sharma is on a distinguished programming path ahead
    .NET Framework
    .NET 2.0 (VS 2005)
    Join Date
    Mar 2009
    Age
    28
    Posts
    16
    Reputation
    21

    Default SHow Context Menu on MenuItem Right click

    I want to show contextMenu on Menu Item Right click..But probs is dat when i right click on menu Item,Context Menu is popping up..But menu disapper..I want that menu should not be disappered...
    ExAMPLE-Suppose we add any favorite in IE,When we right click on that favorite context Menu is popping up,whether we want to delete that favorite,rename that favorite...& so on..
    See in Attachment
    Code:
        Private Sub MenuAddToFavorites_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MenuAddToFavorites.MouseDown
    
            If e.Button = Windows.Forms.MouseButtons.Right Then
                'ContextMenuFavorites.Show(e.Location)
                ContextMenuFavorites.Show(DirectCast(sender, ToolStripMenuItem).GetCurrentParent.PointToScreen(e.Location))
            End If
        End Sub
    Attached Images

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts