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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to minimize an MDI Parent form into the System Tray?

Status
Not open for further replies.

wichan

Programmer
Jul 21, 2016
2
TH
My project use a MDI application. I want to minimize my main form into the System Tray. I've search for the coding but I found coding for Form to System Tray. But it's not work for MDIForm. What can be done to achieve the same result?

Thanks
 
Thanks, I knew I had to be missing something. Turns out it was so big I couldn't see it. ;-)

I just took an existing small MDI demo and added "minimize to tray" and a simple "restore on tray icon click" to the MDIForm. Works fine, as expected.

Perhaps you can describe the specific thing you need help with.
 
I tested that using the version 5 NotifyIcon.ctl from NotifyIcon - Tray Icon Control.

I just added the Subclasser.bas and Notifyicon.ctl modules to the MDI Project, added an instance of the NotifyIcon control to the MDIForm, assigned it an Icon, added code:

Code:
Private Sub MDIForm_Resize()
    If WindowState = vbMinimized Then NotifyIcon1.MinimizeToTray Me
End Sub

Private Sub NotifyIcon1_Click()
    NotifyIcon1.Restore True
End Sub
 
Hi dilettante and strongm
Everything worked perfectly.
Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top