Control change focus in tool window

Docking/MDI for Windows Forms Forum

Posted 11 years ago by Jean Darveau
Version: 2.0.0105
Platform: .NET 3.0
Environment: Windows XP (32-bit)
Avatar
I have a form with 3 dock tool window, on any tool windows, add 3 textbox. Put the cursor in the first one, then clique on the title bar of the parent tool window of those textbox. Each time you click, the focus will change to the second textbox, another click it will go to the third textbox... Am I missing something here ?
Even with the cause validation to false for the 3 textbox and the tool window, it stil recreate the "bug".

Jean
(sorry for my bad english)

Comments (4)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jean,

All our code does when you click on the title bar is call the selected tool window's Focus() method. I'm not sure why focus would cause the sequence of focus changes you described. If anything I would think it would focus the first textbox each time it was clicked.

If you think there is a problem with our code, perhaps you can put together a simple sample project that shows it and email it over to our support address so we can have a look. Thanks.


Actipro Software Support

Posted 11 years ago by Jean Darveau
Avatar
You can reproduce this with those simple steps

1. Use Visual Studio Professional 2005 (english) UILanguage = 1033
2. Create a C# Windows application
3. Add a dock manager in the mainform (drag and drop from the toolbox)
4. Create a new tool window with the link in the properties windows
5. Change the Text property of the main form for anything - this will generate the line "this.Controls.Add(this.toolWindowContainer1);" in the Form1.Designer.cs
6. Add 2 textbox on the tool windows
7. Run the application
8. click on the first textbox to put the cursor in
9. click on the title bar

Jean
(sorry for my bad english)
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jean,

It seems that calling Focus() on the tool window is moving the focus around in the child controls. We'll change our code to not call Focus() if the tool window already contains focus. That resolves it.


Actipro Software Support

Posted 11 years ago by Jean Darveau
Avatar
Thank you for your fast answer and great customer service!

Jean
(Sorry for my bad english)
The latest build of this product (v2020.1 build 0400) was released 9 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.