private void LightIcon_MouseDown_1(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { currentPoint = this.PointToClient(Cursor.Position); //assigns cursor position to variable to be used in timer code Pressed = true; //icon is currently being 'drug' if (myTimer.Enabled == false) { myTimer.Enabled = true; //enables timer } //remove icon from toolbox, add to form (change parent to form) toolboxPanel.Controls.Remove(this); form.bitmappanel.Controls.Add(this); //hide toolbox toolboxPanel.SendToBack(); //this.BackgroundImage = new Bitmap("idea.png"); if (thisLight != null) { thisLight.ToggleOnOff(); } } else if (e.Button == MouseButtons.Right && light is DimmerOut) { propform = new PropertiesForm((DimmerOut)light); propform.ShowDialog(); } }
private void propertiesToolStripMenuItem_Click(object sender, EventArgs e) { if ((light != null) && (light is DimmerOut)) { PropertiesForm propertiesForm = new PropertiesForm((DimmerOut)light); propertiesForm.Show(); this.Hide(); } }