// public bool enabled; // public System.Drawing.Color color; public LoadCellIcon(frmMain main, System.Drawing.Image image, int loadCellID, int iconID) { MainForm = main; loadCell = (loadCellID+1); icon = iconID; name = "LC: " + (loadCell).ToString(); // pictureBox // panelPic.Dock = System.Windows.Forms.DockStyle.Fill; panelPic.Image = image; panelPic.Location = new System.Drawing.Point(0, 20); panelPic.Size = new System.Drawing.Size(20, 20); panelPic.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; panelPic.TabIndex = 4; panelPic.TabStop = false; // // textBox // panelText.Location = new System.Drawing.Point(2 , 50); panelText.Size = new System.Drawing.Size(46, 20); panelText.TabIndex = 0; panelText.Text = ""; panelText.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; panelText.ReadOnly = true; // // textBox2 // panelText2.Location = new System.Drawing.Point(2, 0); panelText2.Size = new System.Drawing.Size(46, 20); panelText2.TabIndex = 0; panelText2.Text = name; panelText2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; panelText2.ReadOnly = true; // // panel // panel.BackColor = Color.Transparent; panel.Location = new System.Drawing.Point(0, 0); panel.Size = new System.Drawing.Size(50, 70); panel.TabIndex = 6; panelPic.MouseDown += new MouseEventHandler(panel_MouseDown); panelText.MouseDown += new MouseEventHandler(panel_MouseDown); panelText2.MouseDown += new MouseEventHandler(panel_MouseDown); main.pictureBox1.Controls.Add(panel); panel.Controls.Add(panelText2); panel.Controls.Add(panelText); panel.Controls.Add(panelPic); }
private void button2_Click(object sender, EventArgs e) { frmMain main = new frmMain(this); main.Show(); this.Hide(); }