コード例 #1
0
        void DropDown_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
              //  Point location = new Point(f1.Location.X, f1.Location.Y + yPos);
                string dirSelected, dirRoot;
                DirectoryInfo nodeDirInfo = new DirectoryInfo(rootDir);

                if (nodeDirInfo.Exists)
                {
                    if (nodeDirInfo.Parent != null)
                    {
                        dirRoot = nodeDirInfo.Parent.FullName.ToString();
                        dirSelected = nodeDirInfo.Name.ToString();
                        IShellContextMenu contextmen = new IShellContextMenu();
                        contextmen.iContextMenu(dirRoot, dirSelected,false);
                    }
                }
            }
        }
コード例 #2
0
        void iItem_Click(object sender, MouseEventArgs e)
        {
            //    Point location = new Point(f1.Location.X, f1.Location.Y + yPos);
            if (e.Button == MouseButtons.Right)
            {
                IShellContextMenu contextmen = new IShellContextMenu();
                ToolStripMenuItemEx mItem = (ToolStripMenuItemEx)sender;
             //               string root = mItem.ToolTipText.Substring(0, mItem.ToolTipText.LastIndexOf("\\")+1);
                string root="";
                if(mItem.Name.Length>0)
                    root = mItem.Name.Substring(0, mItem.Path.LastIndexOf("\\")+1);
                else
                    root = mItem.Path.Substring(0, mItem.Path.LastIndexOf("\\")+1);

                contextmen.iContextMenu(root, sender.ToString(), false);
            }
            if (e.Button == MouseButtons.Left)
                iItem_DoubleClick(sender, e);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: priceLiu/ServerController
 //Show folder contents when clicking on drive progressbar
 private void PBAR_MOUSE_DOWN(object sender, EventArgs e)
 {
     ProgressODoom.ProgressBarEx pBar = (ProgressODoom.ProgressBarEx)sender;
     string sDrive = pBar.Text;
     sDrive = sDrive.Remove(sDrive.IndexOf(":") + 1) + "\\";
     MouseEventArgs me = (MouseEventArgs)e;
     if (me.Button == MouseButtons.Right)
     // ShellExtensions.ShowFileProperties(sDrive);
     {
         IShellContextMenu cMenu = new IShellContextMenu();
         cMenu.iContextMenu("", sDrive, true);
     }
     else
     {
         FileBrowser fb = new FileBrowser(this, pBar.Width, cLabel[iFunction[3]].Top);
         fb.populateList(sDrive);
     }
 }