Beispiel #1
0
        //Right click to open context menu - need to fix
        private void PositionsGridView_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                int currentMouseOverRow = PositionsGridView.HitTest(e.X, e.Y).RowIndex;

                if (currentMouseOverRow >= 0)
                {
                    ListViewContextMenu.Show(Cursor.Position);
                }

                //ContextMenu m = new ContextMenu();
                //m.MenuItems.Add(new MenuItem("Cut"));
                //m.MenuItems.Add(new MenuItem("Copy"));
                //m.MenuItems.Add(new MenuItem("Paste"));

                //int currentMouseOverRow = PositionsGridView.HitTest(e.X, e.Y).RowIndex;

                //if (currentMouseOverRow >= 0)
                //{
                //    m.MenuItems.Add(new MenuItem(string.Format("Do something to row {0}", currentMouseOverRow.ToString())));
                //}

                //m.Show(PositionsGridView, new Point(e.X, e.Y));
            }
        }
Beispiel #2
0
 private void DirBrowser_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         if (DirBrowser.FocusedItem != null && DirBrowser.FocusedItem.Bounds.Contains(e.Location))
         {
             __selectedItems = DirBrowser.SelectedItems;
             __focusedItem   = DirBrowser.FocusedItem;
             ListViewItemContextMenu.Show(Cursor.Position);
             return;
         }
         else
         {
             ListViewContextMenu.Show(Cursor.Position);
         }
     }
 }