473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Multiple NotifyIcons (one per Thread)?

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
Nov 29 '05 #1
2 1555
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?

Nov 29 '05 #2
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(Threadin g.ApartmentState.STA)

'Start Thread
GlobalVars.ERSThread.Start()


Best regards / MfG,
--
Joerg Battermann
jb@justBE.com
http://www.justBE.com - blog: http://blog.justBE.com

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

Nov 30 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Andrae Muys | last post by:
Found myself needing serialised access to a shared generator from multiple threads. Came up with the following def serialise(gen): lock = threading.Lock() while 1: lock.acquire() try: next...
7
by: Guyon Morée | last post by:
If I have multiple threads reading from the same file, would that be a problem? if yes, how would I solve it? Let's say I want to take it a step further and start writing to 1 file form...
4
by: Tony Liu | last post by:
Hi, how can I create multiple new file handles of a file without having to share to file to the other processes? I have a file that will be accessed by multiple threads in my application, each...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
3
by: Michel | last post by:
Hi, I wrote an app in .Net and I whant only 1 instance of this app open for the user; the user open my app, do some works and try to open another instance of my app, I whant to show a message to...
3
by: ian_jacobsen | last post by:
First let me start by saying that this problem is not consistently reproducible. I have a windows service that creates reports for a group of entities. This service can process multiple groups at...
2
by: jasonsgeiger | last post by:
From: "Factor" <jasonsgeiger@gmail.com> Newsgroups: microsoft.public.in.csharp Subject: Multiple Clients, One port Date: Wed, 19 Apr 2006 09:36:02 -0700 I'm been working with sockets for a...
2
by: PAzevedo | last post by:
I have this Hashtable of Hashtables, and I'm accessing this object from multiple threads, now the Hashtable object is thread safe for reading, but not for writing, so I lock the object every time I...
1
by: abhey | last post by:
i am working on a application which has timers set up in it as System.Threading.Timer timer = new System.Threading.Timer(timerDelegate, autoEvent, new TimeSpan(0, 0, 0), new TimeSpan(0, 0, 0, 0,...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.