private void SetCurrentEditor(string action) { if (action == "") { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); } } else { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); currentEditor.OnTextChanged -= OnTextChanged; } if (SelectedShowItem != null) { SelectedShowItem.Action = ActionStringToAction(action); currentEditor = SelectedShowItem.Editor; currentEditor.Location = new Point(4, 16); currentEditor.Dock = DockStyle.Fill; currentEditor.OnTextChanged += OnTextChanged; groupBoxItemEdit.Controls.Add(currentEditor); } else { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Information; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("SetCurrentEditor: SelectedShowItem == null", "Color Setup", false, false); messageBox.ShowDialog(); } } }
private void SetCurrentEditor(string action) { if (action == "") { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); } } else { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); } if (SelectedShowItem != null) { SelectedShowItem.Action = ActionStringToAction(action); currentEditor = SelectedShowItem.Editor; currentEditor.Location = new Point(4, 16); currentEditor.Width = groupBoxItemEdit.Width - (currentEditor.Left * 2); currentEditor.OnTextChanged += OnTextChanged; groupBoxItemEdit.Controls.Add(currentEditor); } else { MessageBox.Show("SetCurrentEditor: SelectedShowItem == null"); } } }
private void SetCurrentEditor(string action) { if (action == "") { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); } } else { if (currentEditor != null) { groupBoxItemEdit.Controls.Remove(currentEditor); } if (SelectedShowItem != null) { SelectedShowItem.Action = ActionStringToAction(action); currentEditor = SelectedShowItem.Editor; currentEditor.Location = new Point(4, 16); currentEditor.Dock=DockStyle.Fill; currentEditor.OnTextChanged += OnTextChanged; groupBoxItemEdit.Controls.Add(currentEditor); } else { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Information; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("SetCurrentEditor: SelectedShowItem == null", "Color Setup", false, false); messageBox.ShowDialog(); } } }
private void UpdateItemText(TypeEditorBase editor) { listViewShowItems.SelectedItems[0].SubItems[0].Text = editor.Text; listViewShowItems.Columns[0].Width = -1; }
public void OnTextChanged(object sender, EventArgs e) { TypeEditorBase editor = sender as TypeEditorBase; UpdateItemText(editor); }
public void OnTextChanged(object sender, EventArgs e) { TypeEditorBase editor = sender as TypeEditorBase; listViewShowItems.SelectedItems[0].SubItems[0].Text = editor.Text; }