mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-04 22:21:23 +12: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
|
@ -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));
|
||||
};
|
||||
|
||||
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();
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue