views:

46

answers:

1

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 Form1 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();
+1  A: 

As I mentioned in my question, I've solved this with:

    if (mnuTrayMenu.InvokeRequired)
        mnuTrayMenu.Invoke(action);
    else
        action();
zerkms