Multiple NotifyIcons (one per Thread)?

  • Thread starter Thread starter Joerg Battermann
  • Start date Start date
J

Joerg Battermann

Hello everyone,

I am currently writing a little vb .net (2.0) based application which
utilizes a thread every now and then which works perfectly until I
started using one NotifyIcon for the Form to minimize the tool to the
systray etc: whenever the tool calls/starts a thread, an additional
NotifyIcon appears in the systray which disappears once the thread is
done... which means I have a couple of them when loading data from
multiple sources.

Why is this or what can I do to have only -one- NotifyIcon no matter how
many threads I use?


Best regards & thanks,
-Joerg
 
Without seeing how and where you are creating your threads and
NotifyIcon objects, it is difficult to say.

Can you post just the code that starts the threads and the code that
creates the NotifyIcon objects?

Does your thread show a form?
 
Chris,

the notifyicon is visible from the start and not started by a thread.
the event that starts a thread is by selecting an entry in a combobox
on the main form and looks like this:

Dim WithEvents RetrieveERSRequirements As RetrieveRequirements

RetrieveERSRequirements = New RetrieveRequirements()

RetrieveERSRequirements.Baseline = GlobalVars.baseline
RetrieveERSRequirements.Session = GlobalVars.session
RetrieveERSRequirements.TracesFrom = True
RetrieveERSRequirements.UDAs = True
RetrieveERSRequirements.RequirementTypeString =
"Engineering Requirement Specification"

'Prepare Thread
GlobalVars.ERSThread = New Threading.Thread(AddressOf
RetrieveERSRequirements.GetRequirements)


GlobalVars.ERSThread.TrySetApartmentState(Threading.ApartmentState.STA)

'Start Thread
GlobalVars.ERSThread.Start()




Best regards / MfG,
--
Joerg Battermann
(e-mail address removed)
http://www.justBE.com - blog: http://blog.justBE.com

PGP-KeyID: 0x77007DA6
PGP-Fingerprint: 0461 F2EC 53EB CEBE 6B73 8EEC 64AD 0606 7700 7DA6
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top