public void FinishEdit() { if (Node != null) { var oldName = Text; var newName = Editor.UIText; if (!oldName.Equals(newName)) { Node.Name = newName; ((INodeProperties)Node.NodeProperties).EndEdit(); if (Node.Name == null) { ParentControl.NodeText.Text = newName; } } if (ParentControl.ParentSurface.Selector.NodeControls.Any() && !ParentControl.ParentSurface.Selector.IsMultiSelect) { ParentControl.ParentSurface.Selector.NodeControls.First().Focus(); } else { ParentControl.Focus(); } UnlinkNodeControl(); } }
/// <summary> /// When the find form is being closed we record the user-changable settings for later restoration /// </summary> private void findForm_Closing(object sender, CancelEventArgs e) { formRestoreData = new MemoryStream(); findForm.GetRestoreData(formRestoreData, new BinaryFormatter()); findForm = null; ParentControl.Focus(); // This is required if an InforForm has been shown. // Otherwise, focus is orphaned. I am not sure why. }
private void SetPos() { if (Count == 1) { pnlSelect.Visible = false; } else { pnlSelect.Visible = true; } DoResize(); lblIndex.Text = SelectedIndex.ToString() + " of " + Count.ToString(); if (ParentControl != null) { ParentControl.Focus(); } }
private void InfoText_Enter(object sender, EventArgs e) { ParentControl.Focus(); }