This is a migrated thread and some comments may be shown as answers.

Trouble with Event DockingManger_DockTabChanged

2 Answers 53 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Shirya
Top achievements
Rank 1
Shirya asked on 24 Oct 2008, 04:35 PM
hello,
Me again, having trouble with the dogkingManager
I have my 3 documentPane in my dockingManager.
And I have the event DockingManger_DockTabChanged(...) with the code:

dim MyDockingManager as Docking.DockingManager = sender 
msgBox (MyDockingManager.ActivateDocument.Text) 


Isn't this event similar to DockingManager_DockTabChanging(...)?
Is it normal?: it doesn't displays  the selected tabbedDocument
It always displays the one that has been "deactivated".
How can i have the real selected Tabbeddocument? (without having to go through the documentPane_activate event)
thanx,
Shirya
(Hope I'm clear--> english isn't my native language)

2 Answers, 1 is accepted

Sort by
0
John
Top achievements
Rank 1
answered on 24 Oct 2008, 05:05 PM
Shirya,
     If you are handling the DockTabChanged and DockTabChanging events, you should be able to use the DockTabChangedEventArgs to see the selected tab.  See the example code below:

        private void dockingManager1_DockTabChanged(object sender, DockTabChangedEventArgs e)  
        {  
            MessageBox.Show(e.Tab.Text);   
        }  
 
        private void dockingManager1_DockTabChanging(object sender, DockTabChangingEventArgs e)  
        {  
            MessageBox.Show(e.Tab.Text);    
        } 

I just tested this code and both times I saw the DocumentPane that was just selected. Is this what you needed?
0
Shirya
Top achievements
Rank 1
answered on 24 Oct 2008, 05:26 PM

Hi John,
The code was just a test.
In fact, I would like the object documentPane. I thought I could have it with the "ActiveDocument" property.
But I think I can work something with what you gave me and the "Controls" property.

Thank you for the answer.
Shirya


Tags
Dock
Asked by
Shirya
Top achievements
Rank 1
Answers by
John
Top achievements
Rank 1
Shirya
Top achievements
Rank 1
Share this question
or