Is there a way to set a window to the top on screen and set focus on it?
I'm having a menu in VB.Net calling a bunch of .exe. Everytime a window apears, it runs itself to the top on screen. But there was a window, problem-able one, with some .dll which make it always stood behind everthing on screen. I cannot fix the .dll, so I'm trying to get the screen to go to the top with my code.
I tried:
Me.Activate()- Nothing happens...
Me.BringToFront()- Nothing happens...
Me.TopMost = True- Always on top, but no focus (dvmn it!!!)
Please help!

5 Years
Discussion Span
Last Post by Eternal Newbie

@Begginnerdev: Yes, I did saw it, but I couldn't find a possible sulution there :(
@eos.park: It's not the problem whether I use .show() or .showdialog(), it's a problem of a custom .dll which I cannot fix. Anw, thks :)


Yes, I did used:

Me.TopMost = True 'Then it will bring the form to top
Me.TopMost = False 'Remove .TopMost state so you can work on other forms, too

Yes, TopMost brings you form to top on screen. That means: You'll see your form on top of everything (even windows which not in your project) and unable to bring it to the back later (it's always on top).
I use True first, bring it to front, then False after then so we can bring it to back later if we want.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.