Try this code (not the same as SetFocusToDwgView but can be helpful):
[DllImport("user32.dll")]
extern static IntPtr SetFocus(IntPtr hWnd);
static void SetFocusToActiveDocument()
{
SetFocus(Application.DocumentManager.MdiActiveDocument.Window.Handle);
}
static void SetFocusToMainWindow()
{
SetFocus(Application.MainWindow.Handle);
}
Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"
Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn