Beispiel #1
0
        public static ToolStripItem GetItemAtDeep(this ToolStrip toolstrip, Point screenPos)
        {
            if (!toolstrip.Visible)
            {
                return(null);
            }

            Point         toolStripLocalPos = toolstrip.PointToClient(screenPos);
            ToolStripItem item = toolstrip.GetItemAt(toolStripLocalPos);

            if (item != null)
            {
                return(item);
            }

            ToolStripDropDownItem dropItem = toolstrip.GetActiveDropDown();

            if (dropItem != null)
            {
                return(dropItem.DropDown.GetItemAtDeep(screenPos));
            }

            return(null);
        }