I found the answer here: How to show the form in front in C #
The winAPI approaches did not work correctly for me, but this happened:
form.TopMost = true; form.TopMost = false;
I initially only set TopMost to true, but I had problems displaying dialog boxes behind the form. Setting TopMost to true seems to bring the form to the fore and hold it there. Setting it to false does not repel it, but allows other forms to be shown in front. I still had problems with focus, so I ended up working with the following:
form.Activate();
Ryan taylor
source share