Click here to Skip to main content
15,902,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: Error Pin
perlmunger11-Feb-06 11:09
perlmunger11-Feb-06 11:09 
QuestionCreate list with Grid and getting Process info in C#. Pin
Yanshof11-Feb-06 1:37
Yanshof11-Feb-06 1:37 
AnswerSome one can help me with this question please ? Pin
Yanshof11-Feb-06 9:02
Yanshof11-Feb-06 9:02 
AnswerRe: Create list with Grid and getting Process info in C#. Pin
Dave Kreskowiak11-Feb-06 10:51
mveDave Kreskowiak11-Feb-06 10:51 
QuestionHow to browse SQL server from a network? Pin
bouli10-Feb-06 21:46
bouli10-Feb-06 21:46 
AnswerRe: How to browse SQL server from a network? Pin
perlmunger11-Feb-06 6:34
perlmunger11-Feb-06 6:34 
QuestionI need Help Pin
BestArtemis10-Feb-06 21:22
BestArtemis10-Feb-06 21:22 
AnswerRe: I need Help Pin
Wayne Phipps10-Feb-06 21:35
Wayne Phipps10-Feb-06 21:35 
QuestionDLL Problem Pin
Expert Coming10-Feb-06 14:06
Expert Coming10-Feb-06 14:06 
AnswerRe: DLL Problem Pin
Dave Kreskowiak10-Feb-06 14:28
mveDave Kreskowiak10-Feb-06 14:28 
GeneralRe: DLL Problem (How?) Pin
Expert Coming10-Feb-06 14:33
Expert Coming10-Feb-06 14:33 
GeneralRe: DLL Problem (How?) Pin
Dave Kreskowiak10-Feb-06 14:56
mveDave Kreskowiak10-Feb-06 14:56 
GeneralRe: DLL Problem (How?) Pin
kourvoisier10-Feb-06 14:59
kourvoisier10-Feb-06 14:59 
GeneralRe: DLL Problem (How?) Pin
Expert Coming10-Feb-06 15:09
Expert Coming10-Feb-06 15:09 
GeneralRe: DLL Problem (How?) Pin
Dave Kreskowiak10-Feb-06 16:50
mveDave Kreskowiak10-Feb-06 16:50 
GeneralRe: DLL Problem (How?) Pin
Expert Coming10-Feb-06 17:09
Expert Coming10-Feb-06 17:09 
GeneralRe: DLL Problem (How?) Pin
Dave Kreskowiak10-Feb-06 17:25
mveDave Kreskowiak10-Feb-06 17:25 
GeneralRe: DLL Problem (How?) Pin
Expert Coming10-Feb-06 17:32
Expert Coming10-Feb-06 17:32 
Question2 question about C#.... Pin
Yanshof10-Feb-06 12:37
Yanshof10-Feb-06 12:37 
AnswerRe: 2 question about C#.... Pin
Expert Coming10-Feb-06 13:03
Expert Coming10-Feb-06 13:03 
AnswerRe: 2 question about C#.... Pin
Sean8910-Feb-06 13:16
Sean8910-Feb-06 13:16 
AnswerRe: 2 question about C#.... Pin
perlmunger10-Feb-06 18:14
perlmunger10-Feb-06 18:14 
This is a fairly commonly asked question. I haven't done it in .NET 2.0, however, here's what I did using .NET 1.1. I'm assuming it probably hasn't changed much.

In your form class, override the WndProc method as follows:
// Hijack the windows message for minimizing the windowing so that
// you simply hide the window rather than close it. This gives the
// appearance of minimizing to the tray.
protected override void WndProc(ref System.Windows.Forms.Message m)
{
	if(m.Msg != 0x0010)
	{
		base.WndProc(ref m);
	}
	else
	{
		this.Hide();
	}
}

As someone else mentioned you will need to use a NotifyIcon. The trick with that, though(at least in .NET 1.1) is that you have to assign an icon to the NotifyIcon that you create in the form designer. Otherwise it won't show up in the tray when you run it.

-Matt

------------------------------------------

The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
QuestionDrawing with c# Pin
kourvoisier10-Feb-06 12:29
kourvoisier10-Feb-06 12:29 
AnswerRe: Drawing with c# Pin
M@dHatter10-Feb-06 12:37
M@dHatter10-Feb-06 12:37 
GeneralRe: Drawing with c# Pin
TheJudeDude10-Feb-06 13:47
TheJudeDude10-Feb-06 13:47 

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.