Click here to Skip to main content
12,701,854 members (34,968 online)
   

C#

 
GeneralRe: DLL Problem (How?) Pin
Dave Kreskowiak10-Feb-06 17:50
memberDave Kreskowiak10-Feb-06 17:50 
GeneralRe: DLL Problem (How?) Pin
ExpertComing10-Feb-06 18:09
memberExpertComing10-Feb-06 18:09 
GeneralRe: DLL Problem (How?) Pin
Dave Kreskowiak10-Feb-06 18:25
memberDave Kreskowiak10-Feb-06 18:25 
GeneralRe: DLL Problem (How?) Pin
ExpertComing10-Feb-06 18:32
memberExpertComing10-Feb-06 18:32 
Question2 question about C#.... Pin
yanshof10-Feb-06 13:37
memberyanshof10-Feb-06 13:37 
AnswerRe: 2 question about C#.... Pin
ExpertComing10-Feb-06 14:03
memberExpertComing10-Feb-06 14:03 
AnswerRe: 2 question about C#.... Pin
Sean8910-Feb-06 14:16
memberSean8910-Feb-06 14:16 
AnswerRe: 2 question about C#.... Pin
perlmunger10-Feb-06 19:14
memberperlmunger10-Feb-06 19: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 13:29
memberkourvoisier10-Feb-06 13:29 
AnswerRe: Drawing with c# Pin
VectorX10-Feb-06 13:37
memberVectorX10-Feb-06 13:37 
GeneralRe: Drawing with c# Pin
TheJudeDude10-Feb-06 14:47
memberTheJudeDude10-Feb-06 14:47 
GeneralRe: Drawing with c# Pin
kourvoisier10-Feb-06 15:54
memberkourvoisier10-Feb-06 15:54 
GeneralRe: Drawing with c# Pin
TheJudeDude10-Feb-06 15:57
memberTheJudeDude10-Feb-06 15:57 
QuestionWindows Service Interaction Pin
perlmunger10-Feb-06 11:45
memberperlmunger10-Feb-06 11:45 
AnswerRe: Windows Service Interaction Pin
Ravi Bhavnani10-Feb-06 12:14
memberRavi Bhavnani10-Feb-06 12:14 
GeneralRe: Windows Service Interaction Pin
perlmunger10-Feb-06 12:30
memberperlmunger10-Feb-06 12:30 
AnswerRe: Windows Service Interaction Pin
Nicholas Butler11-Feb-06 1:28
memberNicholas Butler11-Feb-06 1:28 
QuestionWhat is 192.168.1.1 Pin
jinzhecheng10-Feb-06 11:18
memberjinzhecheng10-Feb-06 11:18 
AnswerRe: What is 192.168.1.1 Pin
Vlad Stanciu10-Feb-06 11:24
memberVlad Stanciu10-Feb-06 11:24 
GeneralRe: What is 192.168.1.1 Pin
perlmunger10-Feb-06 11:35
memberperlmunger10-Feb-06 11:35 
AnswerRe: What is 192.168.1.1 Pin
kourvoisier10-Feb-06 13:06
memberkourvoisier10-Feb-06 13:06 
QuestionValidate Windows Forms Data Pin
Wayne Phipps10-Feb-06 11:02
memberWayne Phipps10-Feb-06 11:02 
AnswerRe: Validate Windows Forms Data Pin
perlmunger10-Feb-06 11:55
memberperlmunger10-Feb-06 11:55 
GeneralRe: Validate Windows Forms Data Pin
Wayne Phipps10-Feb-06 12:10
memberWayne Phipps10-Feb-06 12:10 
GeneralRe: Validate Windows Forms Data Pin
perlmunger10-Feb-06 12:53
memberperlmunger10-Feb-06 12:53 

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.


Advertise | Privacy | Mobile
Web02 | 2.8.170118.1 | Last Updated 24 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid