icon in the taskbar notification area(where we see the system time) (Urgent Help) 
Author Message
 icon in the taskbar notification area(where we see the system time) (Urgent Help)

Hi all,
     I have a requirement when i am closing my application  my project icon
should apper in the task bar notification area(where we see time) and when
we click it the application exe should run.

can any one please help me ASAP.

Thanks and regards,
bhagavan vedavyas .A



Mon, 09 May 2005 14:32:21 GMT  
 icon in the taskbar notification area(where we see the system time) (Urgent Help)
Hi all,
     I have a requirement when i am closing my application  my project icon
should apper in the task bar notification area(where we see time) and when
we click it the application exe should run.

can any one please help me ASAP.

Thanks and regards,
bhagavan vedavyas .A



Mon, 09 May 2005 14:33:45 GMT  
 icon in the taskbar notification area(where we see the system time) (Urgent Help)
Hi,
In order to make the icon appear on tray area, try the following code:

                private bool bCanClose;
                public Form1()
                {
                        //
                        // Required for Windows Form Designer support
                        //
                        InitializeComponent();
                        this.bCanClose = false;
                        //
                        // TODO: Add any constructor code after InitializeComponent call
                        //
                }

                /// <summary>
                /// Clean up any resources being used.
                /// </summary>
                protected override void Dispose( bool disposing )
                {
                        if( disposing )
                        {
                                if (components != null)
                                {
                                        components.Dispose();
                                }
                        }
                        base.Dispose( disposing );
                }

                #region Windows Form Designer generated code
                /// <summary>
                /// Required method for Designer support - do not modify
                /// the contents of this method with the code editor.
                /// </summary>
                private void InitializeComponent()
                {
            this.components = new System.ComponentModel.Container();
            System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
            this.contextMenu1 = new System.Windows.Forms.ContextMenu();
            this.menuItem1 = new System.Windows.Forms.MenuItem();
            this.menuItem2 = new System.Windows.Forms.MenuItem();
            //
            // notifyIcon1
            //
            this.notifyIcon1.ContextMenu = this.contextMenu1;
            this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
            this.notifyIcon1.Text = "notifyIcon1";
            this.notifyIcon1.Visible = true;
            //
            // contextMenu1
            //
            this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
                                                                                         this.menuItem1,
                                                                                         this.menuItem2});
            //
            // menuItem1
            //
            this.menuItem1.Index = 0;
            this.menuItem1.Text = "Close Me";
            this.menuItem1.Click += new System.EventHandler(this.menuItem1_Click);
            //
            // menuItem2
            //
            this.menuItem2.Index = 1;
            this.menuItem2.Text = "Show Me";
            this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
            //
            // Form1
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(292, 273);
            this.Name = "Form1";
            this.Text = "Form1";
            this.Closing += new System.ComponentModel.CancelEventHandler(this.Form1_Closing);
            this.GiveFeedback += new System.Windows.Forms.GiveFeedbackEventHandler(this.Form1_GiveFeedback);

        }
                #endregion

                /// <summary>
                /// The main entry point for the application.
                /// </summary>
                [STAThread]
                static void Main()
                {
                        Application.Run(new Form1());
                }

        private void textBox1_TextChanged(object sender, System.EventArgs e)
        {
            MessageBox.Show(this, "Changed!");
        }

        private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (!this.bCanClose)
            {
                e.Cancel = true;
                this.Hide();
            }
        }

        private void Form1_GiveFeedback(object sender, System.Windows.Forms.GiveFeedbackEventArgs e)
        {

        }

        private void menuItem1_Click(object sender, System.EventArgs e)
        {
            this.bCanClose = true;
            this.Close();
        }

        private void menuItem2_Click(object sender, System.EventArgs e)
        {
            this.Show();
        }

Best regards,
Richard Chen
Microsoft

This posting is provided "AS IS" with no warranties, and confers no rights.



Mon, 09 May 2005 16:07:46 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Icons in taskbar notification area

2. Running app as an icon in taskbar notification area (systay)

3. icon in Taskbar notification area

4. Displaying text in taskbar notification area?

5. taskbar notification area.

6. Displaying text in taskbar notification area?

7. Loading an icon in the taskbar (beside the time) -- like the volume icon

8. Loading an icon in the taskbar (beside the time) -- like the volume icon

9. Taskbar notification icons

10. Show app icon on notification area of task bar

11. Taskbar notify area and app's icon position

12. icons in taskbar status area

 

 
Powered by phpBB® Forum Software