Create new Word-inspired project and add CommandExecuting event handler with the following code:
private void radRichTextEditor1_CommandExecuting(object sender, Telerik.WinForms.Documents.RichTextBoxCommands.CommandExecutingEventArgs e)
{
if (e.Command is Telerik.WinForms.Documents.RichTextBoxCommands.SaveCommand)
{
e.Cancel = true;
var newForm = new MainForm();
newForm.Show();
}
}
When I click on Save quick-button I expect to see new form active and in focus, but what actually happens is that new form is created, gets in focus briefly, and then the old form steals the focus. How can I fix the focus steal? I need new form to be non-modal.
In theory I should be able to do it if I call Show(this) instead of Show(), and in OnShown overload set Owner = null, but even though the active window now is the new form, the keyboard focus is still on old form (type something to see). I suspect there is some OnTimer interference. Do you have an adequate solution?