public override void OnMouseMove(UIEvent e) { base.OnMouseMove(e); if (e.leftMouseDown) { // Left mouse button is currently down. // Grab the dropdown box: Element dropdown = GetDropdownBox(); // Is it outside the select menu and outside the dropdown box? if (!Element.IsMousedOver() && !dropdown.IsMousedOver()) { // Yep it is - Clicked outside the dropdown menu. // Hide it now: Hide(); } } }