Bringing windows to the front

G

Guest

I have a .Net 2 WinForms apps that can spawn off co-existing multiple windows
(appears in task bar).

I want to bring the new windows to front without making them top most (so
Alt+Tab will work). How can I do this?

I experimented with
this.SendToBack()
newForm.Show()
newForm.BringToFront()
newForm.Activate()
newForm.Focus()
newForm.aControlInNewForm.Focus()
 
G

Guest

Hi,
you can try this code:
newForm.ShowInTaskBar = true;
newForm.WindowState = FormWindowState.Normal;
newForm.Activate();
Because activate works only when state of form is not minimized.Or else if
this does not work then you use SetForeGroundWindow API.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top