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

How to hide Floating ToolWindow titlebar?

2 Answers 99 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michelle
Top achievements
Rank 1
Michelle asked on 06 Jul 2011, 07:52 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Alexander
Telerik team
answered on 12 Jul 2011, 02:48 PM
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!

0
Michelle
Top achievements
Rank 1
answered on 12 Jul 2011, 04:24 PM
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
Tags
Dock
Asked by
Michelle
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Michelle
Top achievements
Rank 1
Share this question
or