How to show a form without having it minimized first?

cesm1980

New member
Joined
Jan 4, 2012
Messages
1
Programming Experience
5-10
I am new here, so i hope this is the right place to post this :)

I am using windows 7 64bit ultimate, and visual studio 2010.

I have a program, which starts minimized and i want the main form to only appear on the screen and with focus, when a specific string is copied into the clipboard anywhere on windows (i use a timer to constantly check the clipboard). I can't just "hide" the form or enable the function of it not appearing in taskbar because i need the program to display text on it's taskbar icon (using the main form's text property) all the time.

When i run the program inside visual studio and in another program i copy the desired string to the clipboard, my program does appear on the screen and has focus even if it's not minimized. But when i run the compiled version of my application, the behavior is a bit different, after the first time i get the program to show up sucessfully, if i DON'T minimize the form again, the next time i am going to try to trigger the form, it just blinks at the taskbar and shows nothing and of course, doesn't set the focus either. This is REALLY annoying since i am forced to alt-tab to access it because i only want to use the keyboard with this program, and since the program does several different operations depending on the string of the clipboard (some of them even show message boxes) it's not pratical put the instruction to minimize the form everytime a task is finished. (besides it's not completly reliable because of the messageboxes). Not to mention that i do a lot of alt-tabbing most of the time and sometimes i accidently switch to this form and i have to minimize it again (manually) because i can't just hide it to have it's text on the taskbar icon.

I already tried many combinations of me.show, Me.WindowState, Me.BringToFront and me.activate but it's useless this seems to be a problem in windows 7 rather than visual basic .net i guess?

I just want to be able to show up the form with a trigger like i programmed it, after the program was alt+tabbed away from or after losing focus WITHOUT having to minimize it all the time, and i noticed this works correctly when running the program inside visual studio IDE...

By the way at the moment the code i use to show the form is :

Me.Show()
Me.WindowState = FormWindowState.Normal
Me.BringToFront()
Me.Activate()
 

Latest posts

Back
Top