tags:

views:

126

answers:

1

Hi

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.

A: 

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.

Kavitesh Singh
i have used Hide() and Show() function only. But why Activate(), as it was working fine with Focus(). I think so ActivateMDIChild is not getting fired after doing hide and show. So i m asking reason where MdiParent could lost control on MdiChild.
James
Can you share the code where you closing and activating the forms?
Kavitesh Singh