Let's suppose I have windowsless application: only NotifyIcon is presented. So I've created the only NotifyIcon that I need. But when I had a Form开发者_C百科1
class I could use form1.Invoke(action)
to perform actions from another thread. And what should I do now?
UPD: this is an answer: we should Invoke() a menu itself
if (mnuTrayMenu.InvokeRequired)
mnuTrayMenu.Invoke(action);
else
action();
As I mentioned in my question, I've solved this with:
if (mnuTrayMenu.InvokeRequired)
mnuTrayMenu.Invoke(action);
else
action();
精彩评论