private void ColorPanel_MouseLeave(object sender, EventArgs e) { if (ColorPanel.Visible) { if (!ColorPanel.RectangleToScreen(ColorPanel.DisplayRectangle).Contains(MousePosition)) { ColorPanel.Hide(); } } }
private void ColorPanel_LostFocus(object sender, EventArgs e) { ColorPanel.Hide(); }