here is the code I use to end the app
Me.Close()
Me.Hide()
m_trayIcon.Icon = Nothing
End
"george d lake" <gero...@cuartel15.com> wrote in message
news:ewCkBAH1...@TK2MSFTNGP10.phx.gbl...
m_trayIcon.Visible = False
End
and iut still stays there. I have to mouseover it in order for it to go
away.
"Mike Bulava" <mbu...@comcast.net> wrote in message
news:u81YXEH1...@TK2MSFTNGP11.phx.gbl...
Set the icon's 'Visible' property to 'False' before closing the form.
> End
Why do you use 'End' here?!
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
It's not a good idea to put statements after Me.Close(). If you do it that
way, you have to wait for GC to clean up after you, because m_trayIcon has
gone out of scope
Steven
"george d lake" <gero...@cuartel15.com> wrote in message
news:eC9HFIH1...@tk2msftngp13.phx.gbl...
"Herfried K. Wagner [MVP]" <hirf-spa...@gmx.at> wrote in message
news:uTvzENH1...@TK2MSFTNGP11.phx.gbl...
There are *only* better ways of doing this.
SCNR
(Sorry, I don't write more - Herfried will *g*)
--
Armin
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
Pass a reference to the form instance and call its 'Close' method.
If your app a Form that happens to have a system tray icon. Or a System Tray
icon that happens to have a form?
In my app, which happens to be a System Tray icon that happens to have a
Form, I had to explicitly call Dispose on the Component where the NotifyIcon
was located, which indirectly caused Dispose to be called on the NotifyIcon.
Note the NotifyIcon was located in a class derived from Component. This
component was my startup object. It had a Shared Sub Main that created a new
instance of the component, then called Application.Run with no parameters.
Elsewhere in my program I would create an instance of a form and call
ShowDialog to show it, based on a Menu click event, the component owned the
Menu & NotifyIcon...
Hope this helps
Jay
"george d lake" <gero...@cuartel15.com> wrote in message
news:ewCkBAH1...@TK2MSFTNGP10.phx.gbl...