mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-05 20:54:31 +13:00
hide codemenu onlostfocus
codemenu was remaining open when the application lost focus because it was tied to the leave event rather than the focus events.
This commit is contained in:
parent
49bb9f7e80
commit
6d91464604
1 changed files with 6 additions and 1 deletions
|
@ -72,7 +72,12 @@ public static ContextMenuStrip Create<TEntry>(TextBox tb, params TEntry[] ignore
|
||||||
if (cms.Items.Count > 0) cms.Show(tb, new Point(tb.Width + 1, 0));
|
if (cms.Items.Count > 0) cms.Show(tb, new Point(tb.Width + 1, 0));
|
||||||
};
|
};
|
||||||
|
|
||||||
tb.Leave += (sender, e) =>
|
tb.GotFocus += (sender, e) =>
|
||||||
|
{
|
||||||
|
if (cms.Items.Count > 0) cms.Show(tb, new Point(tb.Width + 1, 0));
|
||||||
|
};
|
||||||
|
|
||||||
|
tb.LostFocus += (sender, e) =>
|
||||||
{
|
{
|
||||||
if (cms.Visible) cms.Close();
|
if (cms.Visible) cms.Close();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue