Yes, you are giving me the same solution you gave in the mentioned thread and I'm here asking if this is the only way (to get rid of the focus problem) and isn't this affecting autocad's speed when a users starts opening forms which instead of being properly closed when their time is over they hung around being invisible.
No, what makes you think that a hidden form affects AutoCAD's speed?
Only if there are hundreds of them, which is not likely.
Most of the palette-based tools you use in AutoCAD do exactly the
same thing - they only hide when you close them, rather than destroy
themselves.
Only in cases where a form is handling some event(s) that fire often,
can there be unnecessary overhead, and of course, if the form is well
designed, it will stop/start handling events when it is hidden/shown.
Also, I want the user to be given a fresh form, without any changes
he might have done last time he used it so your way is just adding
extra work...
It depends on the particulars. In most cases, I want a form to be in
the exact same state it was in when it was last visible. If that's not
what you want, there's no point to using the code I show, and you
can just let the form dispose itself when closed, and create another
instance when you need to show it again.
Regarding the focus problem, you're playing a bit of a guessing game
with us, because it could depend on how certain Form properties are
set (TopMost and ShowInTaskBar being the usual suspects), as well
as what your call to MessageBox.Show() looks like.
So, if someone here can guess exactly what's going on in your code
that may be causing the problem, do they win a free, all-expense-paid
trip to DisneyLand, or something like that?