Click here to Skip to main content
15,891,248 members
Articles / Programming Languages / C#

Window Tray Minimizer

Rate me:
Please Sign up or sign in to vote.
4.91/5 (60 votes)
26 Oct 2007CPOL6 min read 179.9K   4.1K   203  
An article showing how to minimize any Window to the system tray
namespace Tray_minimizer
{
    partial class Options
    {
        /// <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.showctrlcheck = new System.Windows.Forms.CheckBox();
            this.showshiftcheck = new System.Windows.Forms.CheckBox();
            this.showaltcheck = new System.Windows.Forms.CheckBox();
            this.label1 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.hidealtcheck = new System.Windows.Forms.CheckBox();
            this.hideshiftcheck = new System.Windows.Forms.CheckBox();
            this.hidectrlcheck = new System.Windows.Forms.CheckBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label7 = new System.Windows.Forms.Label();
            this.hidekeycombo = new System.Windows.Forms.ComboBox();
            this.showkeycombo = new System.Windows.Forms.ComboBox();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.startcheck = new System.Windows.Forms.CheckBox();
            this.button1 = new System.Windows.Forms.Button();
            this.button2 = new System.Windows.Forms.Button();
            this.ignoretitlecheck = new System.Windows.Forms.CheckBox();
            this.groupBox1.SuspendLayout();
            this.SuspendLayout();
            // 
            // showctrlcheck
            // 
            this.showctrlcheck.AutoSize = true;
            this.showctrlcheck.Location = new System.Drawing.Point(12, 88);
            this.showctrlcheck.Name = "showctrlcheck";
            this.showctrlcheck.Size = new System.Drawing.Size(41, 17);
            this.showctrlcheck.TabIndex = 0;
            this.showctrlcheck.Text = "Ctrl";
            this.showctrlcheck.UseVisualStyleBackColor = true;
            // 
            // showshiftcheck
            // 
            this.showshiftcheck.AutoSize = true;
            this.showshiftcheck.Location = new System.Drawing.Point(59, 88);
            this.showshiftcheck.Name = "showshiftcheck";
            this.showshiftcheck.Size = new System.Drawing.Size(47, 17);
            this.showshiftcheck.TabIndex = 1;
            this.showshiftcheck.Text = "Shift";
            this.showshiftcheck.UseVisualStyleBackColor = true;
            // 
            // showaltcheck
            // 
            this.showaltcheck.AutoSize = true;
            this.showaltcheck.Location = new System.Drawing.Point(112, 88);
            this.showaltcheck.Name = "showaltcheck";
            this.showaltcheck.Size = new System.Drawing.Size(38, 17);
            this.showaltcheck.TabIndex = 2;
            this.showaltcheck.Text = "Alt";
            this.showaltcheck.UseVisualStyleBackColor = true;
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(56, 63);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(52, 13);
            this.label1.TabIndex = 4;
            this.label1.Text = "Modifiers:";
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(247, 63);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(52, 13);
            this.label2.TabIndex = 8;
            this.label2.Text = "Modifiers:";
            // 
            // hidealtcheck
            // 
            this.hidealtcheck.AutoSize = true;
            this.hidealtcheck.Location = new System.Drawing.Point(304, 88);
            this.hidealtcheck.Name = "hidealtcheck";
            this.hidealtcheck.Size = new System.Drawing.Size(38, 17);
            this.hidealtcheck.TabIndex = 7;
            this.hidealtcheck.Text = "Alt";
            this.hidealtcheck.UseVisualStyleBackColor = true;
            // 
            // hideshiftcheck
            // 
            this.hideshiftcheck.AutoSize = true;
            this.hideshiftcheck.Location = new System.Drawing.Point(251, 88);
            this.hideshiftcheck.Name = "hideshiftcheck";
            this.hideshiftcheck.Size = new System.Drawing.Size(47, 17);
            this.hideshiftcheck.TabIndex = 6;
            this.hideshiftcheck.Text = "Shift";
            this.hideshiftcheck.UseVisualStyleBackColor = true;
            // 
            // hidectrlcheck
            // 
            this.hidectrlcheck.AutoSize = true;
            this.hidectrlcheck.Location = new System.Drawing.Point(203, 88);
            this.hidectrlcheck.Name = "hidectrlcheck";
            this.hidectrlcheck.Size = new System.Drawing.Size(41, 17);
            this.hidectrlcheck.TabIndex = 5;
            this.hidectrlcheck.Text = "Ctrl";
            this.hidectrlcheck.UseVisualStyleBackColor = true;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.hidekeycombo);
            this.groupBox1.Controls.Add(this.showkeycombo);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.hidealtcheck);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.hideshiftcheck);
            this.groupBox1.Controls.Add(this.hidectrlcheck);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Controls.Add(this.showshiftcheck);
            this.groupBox1.Controls.Add(this.showctrlcheck);
            this.groupBox1.Controls.Add(this.showaltcheck);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Location = new System.Drawing.Point(14, 53);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(355, 225);
            this.groupBox1.TabIndex = 9;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Hotkeys";
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Location = new System.Drawing.Point(45, 189);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(265, 26);
            this.label7.TabIndex = 13;
            this.label7.Text = "If key is None or none of the modifiers is selected then \r\nthere will be no hotke" +
                "y assocciated for command";
            this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
            // 
            // hidekeycombo
            // 
            this.hidekeycombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.hidekeycombo.FormattingEnabled = true;
            this.hidekeycombo.Items.AddRange(new object[] {
            "None"});
            this.hidekeycombo.Location = new System.Drawing.Point(247, 155);
            this.hidekeycombo.Name = "hidekeycombo";
            this.hidekeycombo.Size = new System.Drawing.Size(51, 21);
            this.hidekeycombo.TabIndex = 12;
            // 
            // showkeycombo
            // 
            this.showkeycombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
            this.showkeycombo.FormattingEnabled = true;
            this.showkeycombo.Items.AddRange(new object[] {
            "None"});
            this.showkeycombo.Location = new System.Drawing.Point(56, 155);
            this.showkeycombo.Name = "showkeycombo";
            this.showkeycombo.Size = new System.Drawing.Size(51, 21);
            this.showkeycombo.TabIndex = 11;
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Location = new System.Drawing.Point(259, 128);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(28, 13);
            this.label6.TabIndex = 10;
            this.label6.Text = "Key:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Location = new System.Drawing.Point(68, 128);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(28, 13);
            this.label5.TabIndex = 9;
            this.label5.Text = "Key:";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Location = new System.Drawing.Point(202, 28);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(126, 13);
            this.label4.TabIndex = 5;
            this.label4.Text = "Hide all command hotkey";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(11, 28);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(131, 13);
            this.label3.TabIndex = 0;
            this.label3.Text = "Show all command hotkey";
            // 
            // startcheck
            // 
            this.startcheck.AutoSize = true;
            this.startcheck.Location = new System.Drawing.Point(14, 23);
            this.startcheck.Name = "startcheck";
            this.startcheck.Size = new System.Drawing.Size(139, 17);
            this.startcheck.TabIndex = 10;
            this.startcheck.Text = "Run program on Startup";
            this.startcheck.UseVisualStyleBackColor = true;
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(83, 300);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(75, 23);
            this.button1.TabIndex = 11;
            this.button1.Text = "Save";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // button2
            // 
            this.button2.Location = new System.Drawing.Point(225, 300);
            this.button2.Name = "button2";
            this.button2.Size = new System.Drawing.Size(75, 23);
            this.button2.TabIndex = 12;
            this.button2.Text = "Cancel";
            this.button2.UseVisualStyleBackColor = true;
            this.button2.Click += new System.EventHandler(this.button2_Click);
            // 
            // ignoretitlecheck
            // 
            this.ignoretitlecheck.AutoSize = true;
            this.ignoretitlecheck.Location = new System.Drawing.Point(200, 23);
            this.ignoretitlecheck.Name = "ignoretitlecheck";
            this.ignoretitlecheck.Size = new System.Drawing.Size(156, 17);
            this.ignoretitlecheck.TabIndex = 13;
            this.ignoretitlecheck.Text = "Ignore windows without title";
            this.ignoretitlecheck.UseVisualStyleBackColor = true;
            // 
            // Options
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(383, 337);
            this.Controls.Add(this.ignoretitlecheck);
            this.Controls.Add(this.button2);
            this.Controls.Add(this.button1);
            this.Controls.Add(this.startcheck);
            this.Controls.Add(this.groupBox1);
            this.MaximizeBox = false;
            this.MaximumSize = new System.Drawing.Size(391, 371);
            this.MinimizeBox = false;
            this.MinimumSize = new System.Drawing.Size(391, 371);
            this.Name = "Options";
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Options";
            this.Load += new System.EventHandler(this.Options_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.CheckBox showctrlcheck;
        private System.Windows.Forms.CheckBox showshiftcheck;
        private System.Windows.Forms.CheckBox showaltcheck;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.CheckBox hidealtcheck;
        private System.Windows.Forms.CheckBox hideshiftcheck;
        private System.Windows.Forms.CheckBox hidectrlcheck;
        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Label label4;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label5;
        private System.Windows.Forms.ComboBox hidekeycombo;
        private System.Windows.Forms.ComboBox showkeycombo;
        private System.Windows.Forms.Label label6;
        private System.Windows.Forms.CheckBox startcheck;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.Button button2;
        private System.Windows.Forms.Label label7;
        private System.Windows.Forms.CheckBox ignoretitlecheck;
    }
}

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)


Written By
Software Developer
Georgia Georgia
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions