Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Show AutoHidden ToolWindow during runtime

Answered Show AutoHidden ToolWindow during runtime

Feed from this thread
  • Viktor avatar

    Posted on Jul 1, 2011 (permalink)

    Hello Telerik,

    I want to show a ToolWindow which is in Autohide state during runtime. (It should just display not change the DockingState)

    I tried ToolWindow.Show(), but the Window isn't shown


    How can I do that?

    Reply

  • Ivan Petrov Ivan Petrov admin's avatar

    Posted on Jul 6, 2011 (permalink)

    Hi Viktor,

    Thank you for writing.

    Consider the following code snippet which achieves your scenario:

    ToolWindow toolWindow = new ToolWindow("Tool Window");
    this.radDock1.DockWindow(toolWindow, toolWindow, DockPosition.Left);
    toolWindow.AutoHide();

    I hope this will help you. If you have further questions, I would be glad to help.

     

    Kind regards,
    Ivan Petrov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

    Reply

  • Viktor avatar

    Posted on Jul 7, 2011 (permalink)

    Hello Ivan,

    Thank you for your reply.

    This part is working fine, but what about the other way around?

    Now showing this Hidden Toolwindow ?

    As i told before, i tried Toolwindow.Show() but that doesn't work.

    I don't want t change the DockingState, I only want to show the ToolWindow


    Regards Viktor

    Reply

  • Answer Ivan Petrov Ivan Petrov admin's avatar

    Posted on Jul 13, 2011 (permalink)

    Hi Viktor,

    Thank you for your replay.

    From what I understand you want to show a given tool window that is already hidden as if you have hovered it with the mouse. For this scenario you will have to use reflection as the method which is responsible for the showing of a tool window is not public. Please consider the following code snippet:

    MethodInfo method = this.radDock1.GetType().GetMethod("ShowAutoHidePopup", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
     
    if (method != null)
    {
      method.Invoke(this.radDock1, new object[] { this.toolWindow.AutoHideTab, AutoHideDisplayReason.TabItemClicked });
    }
    In the above snippet this.toolWindow is the tool window you want to show. In my case I have as a field, because I use the code snippet from my previous post to add a tool window to the dock.

    I hope this is what you are looking for. Should you have further questions, feel free to contact us.

    All the best,
    Ivan Petrov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

    Reply

  • Francois avatar

    Posted on Feb 7, 2012 (permalink)

    That code doesn't seem to work anymore with 2011 Q3 SP1, am I wrong?

    EDIT: Nevermind ;)

    Reply

  • Ivan Petrov Ivan Petrov admin's avatar

    Posted on Feb 10, 2012 (permalink)

    Hi Francois,

    Thank you for writing.

    In case someone else looks for this information, there is now a public ShowAutoHidePopup method which can be used to accomplish this task.

    If you have other questions, feel free to write back.

    All the best,
    Ivan Petrov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Dock > Show AutoHidden ToolWindow during runtime
Related resources for "Show AutoHidden ToolWindow during runtime"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]