public EngineControl(AEControl me,Engine e)
                : this()
            {
                Label label = new System.Windows.Forms.Label();
                me.Controls.Add(label);
                label.Text = e.name;
                label.AutoSize = true;
                label.Location = new System.Drawing.Point(39 + ((e.id - 1) * 120), 18);
                label.Name = e.name;
                label.Size = new System.Drawing.Size(31, 13);
                label.TabIndex = e.id;
                label.Text = e.name;
                foreach (Channel c in e.Channels.Values)
                {
                    ChannelButtons.Add(c.number, new ChannelButton(c,(AEControl) me));
                    this.Controls.Add(ChannelButtons[c.number]);
                }
                me.Controls.Add(this);
                this.SuspendLayout();
                this.Location = new System.Drawing.Point(39+((e.id-1)*120), 28);
                this.Name = e.name;
                this.Size = new System.Drawing.Size(115, 100);
                this.TabIndex = e.id;
                this.BackColor = System.Drawing.SystemColors.Desktop;
                this.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;

                this.PerformLayout();
            }
 private void button1_Click(object sender, EventArgs e)
 {
     AEControl fo = new AEControl();
 }
 public ChannelButton(Channel ch,AEControl me)
 {
     channel = ch;
     this.Text = "CH" + ch.number.ToString() + ":" + ch.name;
     this.TextAlign = ContentAlignment.MiddleLeft;
     this.Click += new EventHandler(me.chb_click);
     this.BackColor = System.Drawing.SystemColors.ButtonFace;
     me.Controls.Add(this);
     this.SuspendLayout();
     this.Location = new System.Drawing.Point(10, 100 + (ch.number * 60));
     this.Name = ch.name;
     this.Size = new System.Drawing.Size(100, 20);
     this.TabIndex = ch.number;
     //                this.PerformLayout();
 }