Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Create Icons at Runtime and Show Them in the System Tray

, 10 Jun 2008
Create dynamic icons at runtime and show them in the system tray
dynicon_demo.zip
DynIcon
DynIcon
DynIcon.suo
res
DynIcon.ico
icon1.ico
dynicon_demo_cs.zip
DynIconCS
DynIconCS
DynIconCS.suo
bin
Release
DynIconCS.exe
DynIconCS.pdb
DynIconCS.vshost.exe
DynIconCS.csproj.user
Properties
Settings.settings
Resources
Icon1.ico
Icon1.ico
dynicon_demo_mfc.zip
DynIcon.suo
DynIcon.ico
icon1.ico
namespace DynIconCS
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (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();
            this.label2 = new System.Windows.Forms.Label();
            this.timer1 = new System.Windows.Forms.Timer(this.components);
            this.label1 = new System.Windows.Forms.Label();
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
            this.BnEnd = new System.Windows.Forms.Button();
            this.BnStop = new System.Windows.Forms.Button();
            this.BnStart = new System.Windows.Forms.Button();
            this.Value1 = new System.Windows.Forms.Label();
            this.Value2 = new System.Windows.Forms.Label();
            this.notifyIcon2 = new System.Windows.Forms.NotifyIcon(this.components);
            this.SuspendLayout();
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(55, 75);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(46, 13);
            this.label2.TabIndex = 13;
            this.label2.Text = "Value 2:";
            // 
            // timer1
            // 
            this.timer1.Interval = 500;
            this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(55, 41);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(46, 13);
            this.label1.TabIndex = 12;
            this.label1.Text = "Value 1:";
            // 
            // notifyIcon1
            // 
            this.notifyIcon1.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon1_MouseDoubleClick);
            // 
            // BnEnd
            // 
            this.BnEnd.Location = new System.Drawing.Point(272, 66);
            this.BnEnd.Name = "BnEnd";
            this.BnEnd.Size = new System.Drawing.Size(75, 23);
            this.BnEnd.TabIndex = 11;
            this.BnEnd.Text = "Close";
            this.BnEnd.UseVisualStyleBackColor = true;
            this.BnEnd.Click += new System.EventHandler(this.BnEnd_Click);
            // 
            // BnStop
            // 
            this.BnStop.Location = new System.Drawing.Point(175, 66);
            this.BnStop.Name = "BnStop";
            this.BnStop.Size = new System.Drawing.Size(75, 23);
            this.BnStop.TabIndex = 10;
            this.BnStop.Text = "Stop";
            this.BnStop.UseVisualStyleBackColor = true;
            this.BnStop.Click += new System.EventHandler(this.BnStop_Click);
            // 
            // BnStart
            // 
            this.BnStart.Location = new System.Drawing.Point(175, 37);
            this.BnStart.Name = "BnStart";
            this.BnStart.Size = new System.Drawing.Size(75, 23);
            this.BnStart.TabIndex = 9;
            this.BnStart.Text = "Start";
            this.BnStart.UseVisualStyleBackColor = true;
            this.BnStart.Click += new System.EventHandler(this.BnStart_Click);
            // 
            // Value1
            // 
            this.Value1.AutoSize = true;
            this.Value1.Location = new System.Drawing.Point(107, 41);
            this.Value1.Name = "Value1";
            this.Value1.Size = new System.Drawing.Size(13, 13);
            this.Value1.TabIndex = 7;
            this.Value1.Text = "0";
            this.Value1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // Value2
            // 
            this.Value2.AutoSize = true;
            this.Value2.Location = new System.Drawing.Point(107, 75);
            this.Value2.Name = "Value2";
            this.Value2.Size = new System.Drawing.Size(13, 13);
            this.Value2.TabIndex = 8;
            this.Value2.Text = "0";
            this.Value2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
            // 
            // notifyIcon2
            // 
            this.notifyIcon2.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon2_MouseDoubleClick);
            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(372, 122);
            this.Controls.Add(this.label2);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.BnEnd);
            this.Controls.Add(this.BnStop);
            this.Controls.Add(this.BnStart);
            this.Controls.Add(this.Value1);
            this.Controls.Add(this.Value2);
            this.Name = "Form1";
            this.Text = "DynIcon";
            this.Resize += new System.EventHandler(this.Form1_Resize);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.Timer timer1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.NotifyIcon notifyIcon1;
        private System.Windows.Forms.Button BnEnd;
        private System.Windows.Forms.Button BnStop;
        private System.Windows.Forms.Button BnStart;
        private System.Windows.Forms.Label Value1;
        private System.Windows.Forms.Label Value2;
        private System.Windows.Forms.NotifyIcon notifyIcon2;
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Holger Lange

Germany Germany
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140826.1 | Last Updated 10 Jun 2008
Article Copyright 2007 by Holger Lange
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid