How to hide Floating ToolWindow titlebar?

3 posts, 1 answers
  1. Michelle
    Michelle avatar
    13 posts
    Member since:
    Nov 2010

    Posted 06 Jul 2011 Link to this post

    Hello,

    How can we hide the titlebar of a floating toolwindow? The titlebar is very large and on a laptop with numerous windows, takes up too much screen realestate. If we can just reduce the height of it to a half or a third, that would be better too.

    I wasn't able to find anything in the properties of the toolwindow. I tried to change this in the Visual Style Builder too, but was unable to find the correct element to adjust.

    Thanks,


    Michelle
  2. Answer
    Alexander
    Admin
    Alexander avatar
    306 posts

    Posted 12 Jul 2011 Link to this post

    Hello Michelle,

    Thank you for your question.

    You can hide the TitleBar of the floating ToolWindows' FloatingParent to accomplish your scenario. It could be achieved using the TransactionCommitted event of RadDock to get the floating windows and the Shown event of the FloatingParent to hide its TitleBar:
    private void radDock1_TransactionCommitted(object sender, RadDockTransactionEventArgs e)
    {
        foreach (DockWindow window in e.Transaction.AssociatedWindows)
        {
            if (window.DockState == DockState.Floating)
            {
                window.FloatingParent.Shown += new EventHandler(FloatingParent_Shown);
            }
        }
    }
     
    private void FloatingParent_Shown(object sender, EventArgs e)
    {
        FloatingWindow window = (FloatingWindow)sender;
        window.Shown -= new EventHandler(FloatingParent_Shown);
        window.FormElement.TitleBar.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }

    I hope it helps.

    Best regards,
    Alexander
    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!

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Michelle
    Michelle avatar
    13 posts
    Member since:
    Nov 2010

    Posted 12 Jul 2011 Link to this post

    Excellent, thanks. The FormElement property was what I missing.

    I find that FormElement.TitleBar.MaxSize = new Size(0, 18) makes for a nicer thin titlebar.

    FormElement.TitleBar.MaxSize = new Size(0, 3) is more aesthetic than setting the Visibility to Collapsed, because it maintains the same border thickness as the rest of the window.


    Michelle
Back to Top