Trouble with Event DockingManger_DockTabChanged

3 posts, 0 answers
  1. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 24 Oct 2008 Link to this post

    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. John
    John avatar
    30 posts
    Member since:
    Aug 2008

    Posted 24 Oct 2008 Link to this post

    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?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Shirya
    Shirya avatar
    40 posts
    Member since:
    Sep 2008

    Posted 24 Oct 2008 Link to this post


    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


Back to Top