CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Jun 2008
    Posts
    154

    [SOLVED] Right Click in TreeView not responding

    C# WinForms.. trying to get a contextMenu to show in TreeView when I right click - but nothing is happening

    Code:
            private void mainView_MouseClick(object sender, MouseEventArgs e)
            {
                if (e.Button == MouseButtons.Right)
                {
                    if (mainView.SelectedNode == null)
                    {
                        Point ClickPoint = new Point(e.X, e.Y);
                        Point ScreenPoint = mainView.PointToScreen(ClickPoint);
                        Point FormPoint = this.PointToClient(ScreenPoint);
                        cntxtMenuTreeNPCCreate.Show(this, FormPoint);
                    }
                }
            }
    Last edited by bixel; January 3rd, 2010 at 07:15 PM.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured