Form Focus Problem

  • Thread starter Thread starter XVida
  • Start date Start date
X

XVida

I have an application which loads a main form which contains text boxes and
other details. This main form has a menu which opens another form. I want to
have both forms accessible (i.e. I don't want the second form to be modal).
However, I *do* want users to keep working in the second window and only
switch to the main window when they need to. Unfortunately, after performing
one or two functions (I'm writing in C# in the .NET Framework -- 2003) in
the second window, the FIRST WINDOW grabs the focus... and I can't find a
way of forcing the second window to KEEP THE FOCUS!!!!

Please help.
 
Are you running the second form in the same thread as the first one? Does
the second form have its own message pump? It's hard to speculate without
seeing how you're invoking the second form, but my first inclination would
be to recommend that you try creating a separate thread for the second form,
and in that thread, calling Application.Run(new mySecondForm).
 
Back
Top