Hello again all,

I'm trying to figure the following:

My application has an invisible form that shows a system tray icon. This icon (as most will know) doesn't always work properly in regards of exitting the application. (It can linger in the tray)
Now, to make this work, I wanted to create a sub in a module that will take care of shutting down the application and then, if I want to - say - shutdown the program from another form (Of the same program) I would call that procedure and it will first make the icon invisible (ntiMain.Visible = False)
The problem is, I don't know how to access objects from a form (any form) in a module. Is this possible?
I tried it with the following sub:

VB Code:
  1. Sub ShutDown()
  2.     Dim frm As Form
  3.     frm = frmMain
  4.     frm.ntiMain.Visible = False
  5.     frm.Close
  6. End Sub

needless to say this doesn't work.

Thanks if you can help me...