This project is read-only.

Manually changing the focus to a newly created tab/DockableContent

Dec 9, 2010 at 2:38 AM


I have what seems to be a very simple problem but I haven't been able to solve it for ages now.

I have the following code:

DockableContent newContent = new NewGeneralWindow(CreateComponent(pivot,Type));

where NewGeneralWindow extends DockableContent.

Everything works almost fine and this code adds my new DockableContent component to the docking manager but no matter what I do I just can't figure out how to set the focus to the new component and switch the view from the old tab to the newly created one. The code shown above almost does it - everything is correctly set in memory but the view will only change if I minimize and then maximize back the whole window. It seems this causes some "redrawDisplay" method to get executed and then the tabs finally switch.

So could someone please tell me what am I missing here? Is there a method that I can call and redraw the screen? Your help will really be appreciated as I've been stuck on this for quite a while.

Thanks in advance.