Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
QuestionComplicated question Pin
DeathJester_7-Apr-06 19:31
DeathJester_7-Apr-06 19:31 
GeneralRe: Complicated question Pin
Guffa7-Apr-06 22:17
Guffa7-Apr-06 22:17 
AnswerRe: Complicated question Pin
Robert Rohde7-Apr-06 23:33
Robert Rohde7-Apr-06 23:33 
AnswerRe: Complicated question Pin
DeathJester_8-Apr-06 20:31
DeathJester_8-Apr-06 20:31 
GeneralRe: Complicated question Pin
Kuira9-Apr-06 13:43
Kuira9-Apr-06 13:43 
QuestionNotifyIcon Program ? Pin
Skoder7-Apr-06 18:05
Skoder7-Apr-06 18:05 
AnswerRe: NotifyIcon Program ? Pin
S. Senthil Kumar7-Apr-06 18:22
S. Senthil Kumar7-Apr-06 18:22 
AnswerRe: NotifyIcon Program ? Pin
kasik8-Apr-06 4:22
kasik8-Apr-06 4:22 
You don't need a form to do this, you just need to start a message loop. In the following example, calling Application.Run() starts the loop meaning that the NotifyIcon won't vanish instantly.
public class TaskTray
{
    [STAThread]
    public static void Main()
    {
        new TaskTray();
        if ( !Application.MessageLoop )
            Application.Run();
    }

    private NotifyIcon nIcon = new NotifyIcon();
    public TaskTray()
    {
        nIcon.Icon = new System.Drawing.Icon( typeof( TaskTray ), "myIcon.ico" );
        nIcon.Visible = true;
        nIcon.DoubleClick += new EventHandler( nIcon_DoubleClick );
    }

    public void nIcon_DoubleClick( object sender, EventArgs e )
    {
        nIcon.Visible = false;
        Application.Exit();
    }
}
Hope this helps Smile | :)

Cheers,
Will H
GeneralRe: NotifyIcon Program ? Pin
Skoder8-Apr-06 11:41
Skoder8-Apr-06 11:41 
Questionsaving remoting state to file Pin
blucas20057-Apr-06 17:46
blucas20057-Apr-06 17:46 
AnswerRe: saving remoting state to file Pin
S. Senthil Kumar7-Apr-06 18:27
S. Senthil Kumar7-Apr-06 18:27 
GeneralRe: saving remoting state to file Pin
blucas20057-Apr-06 21:24
blucas20057-Apr-06 21:24 
GeneralRe: saving remoting state to file Pin
S. Senthil Kumar8-Apr-06 18:55
S. Senthil Kumar8-Apr-06 18:55 
AnswerRe: Windows service memory utilization Pin
S. Senthil Kumar7-Apr-06 18:31
S. Senthil Kumar7-Apr-06 18:31 
QuestionExcel Spreadsheet Pin
Monin D.7-Apr-06 9:48
Monin D.7-Apr-06 9:48 
AnswerRe: Excel Spreadsheet Pin
Braulio Dez7-Apr-06 10:03
Braulio Dez7-Apr-06 10:03 
GeneralRe: Excel Spreadsheet Pin
Monin D.7-Apr-06 23:23
Monin D.7-Apr-06 23:23 
AnswerRe: Excel Spreadsheet Pin
Graham Nimbley9-Apr-06 15:02
Graham Nimbley9-Apr-06 15:02 
QuestionTreeListView Pin
Robert M Greene7-Apr-06 9:39
Robert M Greene7-Apr-06 9:39 
AnswerRe: TreeListView Pin
Josh Smith10-Apr-06 3:41
Josh Smith10-Apr-06 3:41 
QuestionProblem with p/invoke in c# Pin
t4ure4n7-Apr-06 8:11
t4ure4n7-Apr-06 8:11 
AnswerRe: Problem with p/invoke in c# Pin
Steve Maier7-Apr-06 8:31
professionalSteve Maier7-Apr-06 8:31 
AnswerRe: Problem with p/invoke in c# Pin
Dan Neely7-Apr-06 8:35
Dan Neely7-Apr-06 8:35 
AnswerRe: Problem with p/invoke in c# Pin
Graham Nimbley9-Apr-06 15:10
Graham Nimbley9-Apr-06 15:10 
GeneralRe: Problem with p/invoke in c# Pin
t4ure4n10-Apr-06 8:30
t4ure4n10-Apr-06 8:30 

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.