protected void OnColorChanged(ColorChangeArgs e) { currentColor = e.NewColor; if (ColorChanged != null) { ColorChanged(this, e); } }
void webColorsList_Click(object sender, System.EventArgs e) { Color color = Color.FromName(webColorsList.Text); ColorChangeArgs ca = new ColorChangeArgs(color, "WebTab"); OnColorChanged(ca); exitLoop = true; Visible = false; }
void systemColorsList_Click(object sender, System.EventArgs e) { Color color = Color.FromName(systemColorsList.Text); currentColor = color; ColorChangeArgs ca = new ColorChangeArgs(color, "SystemTab"); OnColorChanged(ca); exitLoop = true; Visible = false; }
void customColorsPage_Click(object sender, System.EventArgs e) { // Get current mouse position Point screenMousePos = Control.MousePosition; // Convert mouse position to client coordinates Point clientMousePos = customColorsPage.PointToClient(screenMousePos); if (rightButtonDown == true) { // Check if we need to show the custom color color picker dialog int index = -1; if (IsSpareColor(clientMousePos, ref index)) { using (CustomColorDlg dlg = new CustomColorDlg()) { dlg.CurrentColor = customColors[index]; if (dlg.ShowDialog(this) == DialogResult.OK) { customColors[index] = dlg.CurrentColor; ColorChangeArgs ca = new ColorChangeArgs(dlg.CurrentColor, "CustomTab"); OnColorChanged(ca); } } } rightButtonDown = false; return; } // Graphics g = customColorsPage.CreateGraphics(); // Color clickedColor = ColorUtil.ColorFromPoint(g, clientMousePos.X, clientMousePos.Y); // g.Dispose(); Color color = FindCustomColor(clientMousePos); if (color != Color.Empty) { ColorChangeArgs ca = new ColorChangeArgs(color, "CustomTab"); OnColorChanged(ca); // Hide the dropdown exitLoop = true; Visible = false; } }
void customColorsPage_Click(object sender, System.EventArgs e) { // Get current mouse position Point screenMousePos = Control.MousePosition; // Convert mouse position to client coordinates Point clientMousePos = customColorsPage.PointToClient(screenMousePos); if ( rightButtonDown == true ) { // Check if we need to show the custom color color picker dialog int index = -1; if ( IsSpareColor(clientMousePos, ref index)) { using (CustomColorDlg dlg = new CustomColorDlg()) { dlg.CurrentColor = customColors[index]; if ( dlg.ShowDialog(this) == DialogResult.OK ) { customColors[index] = dlg.CurrentColor; ColorChangeArgs ca = new ColorChangeArgs(dlg.CurrentColor, "CustomTab"); OnColorChanged(ca); } } } rightButtonDown = false; return; } // Graphics g = customColorsPage.CreateGraphics(); // Color clickedColor = ColorUtil.ColorFromPoint(g, clientMousePos.X, clientMousePos.Y); // g.Dispose(); Color color = FindCustomColor(clientMousePos); if ( color != Color.Empty ) { ColorChangeArgs ca = new ColorChangeArgs(color, "CustomTab"); OnColorChanged(ca); // Hide the dropdown exitLoop = true; Visible = false; } }
protected void OnColorChanged(ColorChangeArgs e) { currentColor = e.NewColor; if ( ColorChanged != null ) ColorChanged(this, e); }
void ColorChanged( object sender, ColorChangeArgs ea) { currentColor = ea.NewColor; InitializeColorTextBoxString(ea.NewColor, ea.SenderName); }
void ColorChanged(object sender, ColorChangeArgs ea) { currentColor = ea.NewColor; InitializeColorTextBoxString(ea.NewColor, ea.SenderName); }