Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an onMinimize procedure 3

Status
Not open for further replies.

Jonah86

Programmer
Dec 11, 2003
152
US
Hey there. I'm making an application that will minimize to the tray, and notify the user when certain dates come about. I'm able to send it to the tray and hide the form with a button, but I wanted to make it so it would hide the form if they were to minimize the app as well. I'd also LIKE to make it so it still runs if they click the 'X' button, and only close when they right click and exit on the icon.

My only real issue, so far, is just making the app do what I want it to do when minimized. I tried using the ApplicationEvents object to use it's "onminimize" event. That works once, but if I then use my menu to "show" the form again...the minimize button stops working entirely. Normally I can minimize the thing to the task bar all I want, and use my menu to "hide" and "show" the form just fine. I just want to be able to "hide" the form on minimize and then "show" it with my menu.

Wow, I that was a lot of "off the cuff" rambling there. I hope someone understands my problem :)

Thanks for reading!
 
Oh, my goodness. I just tried something else. If I "show" my form via the menu, then "hide" and "show" again...the minimize button stops working. So I guess the AppEvent object wasn't the problem there.

Any ideas why the minimize button might stop working like this?
 
Hmm. It seems to happen when I "hide" the form while it's minimized. Which would explain why it was happening with the "onminimize" event I guess.

Why would it be doing this?

I might just have a whole thread to myself on this one I think ;)
 
Ok. The problem here is the form needs to be "restored" after being hidden while minimized. The form is visible on the screen but still needs to be restored before you can interact with it.

How would I go about restoring the form in the code upon "showing" the form? I can't seem to figure that out.

Sorry about this "train of thought" thread. I know this is probably a simple problem to most of you :)
 
So I used application.restore. That seems to be working. If I restore it after minimizing it, it doesn't have focus for some reason, I tried to setfocus...to no avail That's a minor issue though.

If I could delete this thread, I would. Sorry for taking up space:)
 
your one person rambling may be helpful for someone else. have a star for solving your problem AND letting someone else know how to do it themselves!

(now it's not a one person thread either!)

Good for you!

leslie
 
You can find some help in the links below (if you need it).




No one describes all the things and issues, but reading the three you will have a very good insight.

If you need, i can post an ancestor form I use for my systray apps; regretabily I have not a simple descendant to show how to use it (all descendents do freaking complex works); you'll need to figure it yourself.

HTH.

buho (A).
 
Thanks a lot for the links. And thanks to lespaul for the kindness.

What a wonderful forum :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top