C# – DockPanel ActivateMDIChild in C#

c#-3.0winforms

I have used WeifenLuo.WinFormsUI.Docking Dockpanel in my project. I have three Document Style DockContent (i.e. A, B, C)in my application which has been arranged in tabbed style. On Focus() method of any of this dockContent (i.e. A, B, C) its getting activated and getting focus well. As per requirement i need to hide all three dockcontent(i.e. A, B, C) n need to show other two (i.e. D,E). And then once particular process get over, i close D,E and show A, B, C.

Then after On Focus() of C, its focus is not getting set. May i know what could be the reason for the same.

Please guide me for the same.

Thanks.

Best Answer

If i understand it correctly you can use the Hide() function available for the forms and then show again using show() function.

Then after On Focus() of C, its focus is not getting set. May i know what could be the reason for the same.

Here after you close the forms, the last form where you want to take the focus can be activated using the Activate(). This will bring focus to the form. Within the form if you need to set the focus to the textbox, you may change it with the tab order in form editor of visual studio.

Related Topic