Confusioner
asked on
How do I 'bring to front' a .NET windows form?
Hi,
I have an MFC application which is calling a C++ .NET windows form (in managed mode). The form displays but it appears behind the calling MFC program.
How do I make this windows form appear in front of all other windows? I have tried using newDlg->BringToFront() but this does not work.
I have an MFC application which is calling a C++ .NET windows form (in managed mode). The form displays but it appears behind the calling MFC program.
How do I make this windows form appear in front of all other windows? I have tried using newDlg->BringToFront() but this does not work.
#pragma managed
void EventingDlg::customiseToolbar()
{
Form1 ^ newDlg = gcnew Form1();
newDlg->ShowDialog();
newDlg->BringToFront();
}
does the comtrol of execution comes to newDlg->BringToFront(); statement during the life time of the dialog?...... can you please confirm that.
ASKER
I'm not too sure what your asking here. The form is definately been created, because it appears on the screen.
That should mean that BringToFront() is called as well, but it doesn't actually do anything
That should mean that BringToFront() is called as well, but it doesn't actually do anything
after showdialog() the next instruction is executed when the dialog closes.
try as :
try as :
#pragma managed
void EventingDlg::customiseToolbar()
{
Form1 ^ newDlg = gcnew Form1();
newDlg->BringToFront();
newDlg->ShowDialog();
}
ASKER
OK tried that, it's still displaying behind my other window.
I also tried putting this line in form1:
this->BringToFront();
but didn't work either.
I also tried putting this line in form1:
this->BringToFront();
but didn't work either.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
evilrix,
Thanks! Exactly what I needed.
Thanks! Exactly what I needed.
Very welcome.