Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET 2.0/VS2005 - BringToFront() simply does not work

Tags:

.net

winforms

BringToFront doesn't work. after called, my form still stays under an file explorer window or any other window it's under. It's clearly visible. It's otherwise fine, but it simply does not move to the foreground when this is called. not even if i do a "show" before, or after.

I can't have the form "topMost" all the time. I just want it to pop into the foreground as if someone clicked its caption. if other windows are shown after it, it should be under them.

I am so desperate with this C**p not working I'm considering doing a mouse click simulation that'll shoot my window/form to the front.

Is this really a bug in .NET?

like image 465
JasonGenX Avatar asked Apr 04 '11 16:04

JasonGenX


1 Answers

I believe you want the Activate method instead. "BringToFront" is inherited from the base "Control" class and just reorders a control within the current form.

like image 83
David Avatar answered Nov 11 '22 20:11

David