focus console based form???

  • Thread starter Thread starter Lore Leuneog
  • Start date Start date
L

Lore Leuneog

Hello

I' invoing a windows form from within a console application. I'm using:

Form1 frm = new Form1();
frm.ShowDialog;

The only problem I can't solve is how can I make the form to the top most
window of the screen. By now it's hidden behind the console and frm.Focus()
doesn't work. Does anyone have a hint or a link for me?

Thank you
Sincerely
Lore
 
This is an odd scenario. ShowDialog is normally meant to take a window handle
that will be
the parent or owner and in turn shows a modal dialog so that you can't interact
with the parent
application until the dialog is closed.

Since you don't have a handle to pass in, your next best option will be to set
the TopMost property.
This has other effects though, such as the form appearing over top of other
windows in addition to
just the console window.
 
Back
Top