0

I got an issue with toolips artifacts. In the application main form there is an toolstrip button with a tooltip text enabled. The click event handler of that buttons hides the main form an starts an other process:

this.Hide();

application.Start();

application.WaitForExit();

this.Show(); 

If I press the button during the tooltip text is shown, the text remains as an artifact on the desktop. How can I avoid this behaivor.

Thanks Andy

LPs
  • 16,045
  • 8
  • 30
  • 61
  • Try calling invalidate before the Hide call. – LPs Feb 05 '15 at 12:28
  • no, that dosen't works – Andy CGN Feb 05 '15 at 12:49
  • I guess that the posted code is managed into OnClick event. This means that main form stops until the new application is not completed. How about use a different thread to launch the new app? – LPs Feb 05 '15 at 12:53
  • *Never* block the UI thread, hiding the window isn't enough as you found out. Use the Process.Exited event instead. You can set the Process.SynchronizingObject to your form to get the callback on your UI thread. – Hans Passant Feb 05 '15 at 13:16
  • Thanks for your answers. I follow Hans suggestion, it sounds a good way. – Andy CGN Feb 05 '15 at 13:52

0 Answers0