Click here to Skip to main content
15,899,124 members
Home / Discussions / C#
   

C#

 
GeneralRe: dynamically address class vairables Pin
Mustafa Ismail Mustafa23-Nov-07 8:33
Mustafa Ismail Mustafa23-Nov-07 8:33 
GeneralRe: dynamically address class vairables Pin
Luc Pattyn23-Nov-07 8:57
sitebuilderLuc Pattyn23-Nov-07 8:57 
GeneralRe: dynamically address class vairables Pin
Mustafa Ismail Mustafa23-Nov-07 10:04
Mustafa Ismail Mustafa23-Nov-07 10:04 
QuestionSerialDataReceivedEventArgs does not fire Pin
stevenlberntsen23-Nov-07 5:55
stevenlberntsen23-Nov-07 5:55 
QuestionDB Table Exsits Pin
half-life23-Nov-07 5:48
half-life23-Nov-07 5:48 
AnswerRe: DB Table Exsits Pin
SABhatti23-Nov-07 11:56
SABhatti23-Nov-07 11:56 
GeneralRe: DB Table Exsits Pin
half-life24-Nov-07 0:52
half-life24-Nov-07 0:52 
QuestionNotifyIcon Click Problem Pin
Sukhjinder_K23-Nov-07 5:48
Sukhjinder_K23-Nov-07 5:48 
NotifyIcon Click Problem

I setup my NotifyIcon named "sysTray" as

<br />
class MainForm : Form<br />
{<br />
void setUpTrayIcon()<br />
{<br />
	sysTray.Icon = Icon.ExtractAssociatedIcon("App.ico");<br />
			<br />
	this.Shown += delegate(object o, EventArgs ev)<br />
	{<br />
		sysTray.Visible = true;<br />
	};<br />
	sysTray.Click += new EventHandler(doSysClick);<br />
	<br />
	MenuItem[] itm = {new MenuItem("Prev", new EventHandler(doPrev)),<br />
				new MenuItem("Next",new EventHandler(doNext)),<br />
				new MenuItem("Stop", new EventHandler(doStop))};<br />
			this.trayMenu = new ContextMenu(itm);<br />
			<br />
	sysTray.ContextMenu = this.trayMenu;<br />
}<br />
}<br />

The Icon showsup correctly in System Tray Area. When I Right Click on it the Menu also shows up. But once the Menu is Poped Up then It does not matter if I click on the Menu or My App's Tray Icon the sysTray.Click Item still gets Fired and my EventHandler, doSysClick is called.

What I expect is that Only when I click on the App Icon in the System Tray should my doSysClick method be called.
If My System Tray Menu is Visible then if I click anywhere outside it, then it should just hide itself (that is the usual behaviour).

So what am I missing?

Thanks...
AnswerRe: NotifyIcon Click Problem Pin
DaveyM6923-Nov-07 8:21
professionalDaveyM6923-Nov-07 8:21 
Questioncombo+sql+C# Pin
sajid.salim.khan23-Nov-07 4:50
sajid.salim.khan23-Nov-07 4:50 
AnswerWhy did you repost your message? Pin
pmarfleet23-Nov-07 5:46
pmarfleet23-Nov-07 5:46 
AnswerRe: combo+sql+C# Pin
Paul Conrad23-Nov-07 7:38
professionalPaul Conrad23-Nov-07 7:38 
Questionstore procedure problem [modified] Pin
Raza Hussain23-Nov-07 4:50
Raza Hussain23-Nov-07 4:50 
AnswerRe: store procedure problem Pin
Rob Philpott23-Nov-07 5:27
Rob Philpott23-Nov-07 5:27 
QuestionSql Table Foriegn Key Problem in C# Pin
sajid.salim.khan23-Nov-07 4:47
sajid.salim.khan23-Nov-07 4:47 
AnswerRe: Sql Table Foriegn Key Problem in C# Pin
Raza Hussain23-Nov-07 5:00
Raza Hussain23-Nov-07 5:00 
Questionhow can I shutdown the pc ? Pin
The Glory23-Nov-07 4:38
The Glory23-Nov-07 4:38 
AnswerRe: how can I shutdown the pc ? Pin
Kristian Sixhøj23-Nov-07 4:49
Kristian Sixhøj23-Nov-07 4:49 
AnswerRe: how can I shutdown the pc ? Pin
Anthony Mushrow23-Nov-07 5:56
professionalAnthony Mushrow23-Nov-07 5:56 
QuestionDeleting row in Event Pin
baerten23-Nov-07 4:20
baerten23-Nov-07 4:20 
QuestionLoad an image from a file Pin
SeeBees23-Nov-07 3:50
SeeBees23-Nov-07 3:50 
AnswerRe: Load an image from a file Pin
Dave Kreskowiak23-Nov-07 5:33
mveDave Kreskowiak23-Nov-07 5:33 
GeneralRe: Load an image from a file Pin
SeeBees23-Nov-07 17:23
SeeBees23-Nov-07 17:23 
GeneralRe: Load an image from a file Pin
Dave Kreskowiak24-Nov-07 4:14
mveDave Kreskowiak24-Nov-07 4:14 
AnswerRe: Load an image from a file Pin
Anthony Mushrow23-Nov-07 7:34
professionalAnthony Mushrow23-Nov-07 7:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.