public void Activate(IDockContent content)
{
if (this.IsFocusTrackingSuspended)
{
this.ContentActivating = content;
return;
}
if (content == null)
return;
DockContentHandler handler = content.DockHandler;
if (handler.Form.IsDisposed)
return; // Should not reach here, but better than throwing an exception
if (ContentContains(content, handler.ActiveWindowHandle))
NativeMethods.SetFocus(handler.ActiveWindowHandle);
if (!handler.Form.ContainsFocus)
{
if (!handler.Form.SelectNextControl(handler.Form.ActiveControl, true, true, true, true))
// Since DockContent Form is not selectalbe, use Win32 SetFocus instead
NativeMethods.SetFocus(handler.Form.Handle);
}
}