protected void OnSelectColor(SelectColorEventArgs e) { if (SelectColor!=null) { SelectColor(this,e); } this.Visible = false; }
//文本的双击事件 private void lb_color_DoubleClick(object sender, EventArgs e) { SelectColorEventArgs e2 = new SelectColorEventArgs(); e2.color = _color; OnSelectColor(e2); }
private void btnEdit_Click(object sender, EventArgs e) { SelectColorEventArgs e2 = new SelectColorEventArgs(); e2.color = _color; OnSelectColor(e2); }
void cb_SelectColor(object sender, SelectColorEventArgs e) { cb.Visible = false; isActive = false; colorDialog.Color = e.color; if (colorDialog.ShowDialog()==DialogResult.OK) { string str = PluginBase.MainForm.CurrentDocument.SciControl.SelText; if (str.Length > 6) { str = str.Substring(0, str.Length - 6); } else { str = ""; } str += (Convert.ToString(colorDialog.Color.R, 16).PadLeft(2, '0') + Convert.ToString(colorDialog.Color.G, 16).PadLeft(2, '0') + Convert.ToString(colorDialog.Color.B, 16).PadLeft(2, '0')); str=str.ToUpper(); PluginBase.MainForm.CurrentDocument.SciControl.ReplaceSel(str); } }