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

FloatingWindow Hide / Show

1 Answer 65 Views
Dock
This is a migrated thread and some comments may be shown as answers.
SPE
Top achievements
Rank 1
SPE asked on 03 Dec 2014, 10:52 AM
Hi.

I made tool window to floating. 

private void MakeDefaultToolWidow(string title, RadForm from)
        {
            ToolWindow newTool = new ToolWindow();

            newTool.Text = title;
            newTool.CloseAction = DockWindowCloseAction.Close;

            from.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            from.TopLevel = false;
            from.Dock = DockStyle.Fill;

            newTool.Controls.Add(from);
            newTool.DefaultFloatingSize = from.Size;

            CurrentDock.FloatWindow(newTool);
            CurrentDock.ActiveWindow = newTool;

            from.Show();
        }


And, I docked this toolwindow to top(or anywhere).

At this time
CurrentDock.FloatingWindows.Count is 1.

And I Undock that toolwindow.
CurrentDock.FloatingWindows Count is 2.

Now Some button click and run belows.

foreach (FloatingWindow floating in CurrentDock.FloatingWindows)
                {
                    floating.Hide();
                }

foreach (FloatingWindow floating in CurrentDock.FloatingWindows)
                {
                    floating.Show();
                }


Dummy FloatingWindow shown.
Dummy is will be diappear when I move it.



I think when toolwindow is docked, FloatingWindows.Count should be decreased.
and Floating again. it will be increase.


I want Hide/Show all FloatingWindows.


check it please.
Thank you.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 08 Dec 2014, 09:51 AM
Hello Spe,

Thank you for writing.

In this case you should add the tool window to the RadDock before making it floating:
private void MakeDefaultToolWidow(string title, RadForm from)
{
    ToolWindow newTool = new ToolWindow();
 
    newTool.Text = title;
    newTool.CloseAction = DockWindowCloseAction.Hide;
 
    from.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    from.TopLevel = false;
    from.BackColor = Color.Red;
    from.Dock = DockStyle.Fill;
 
    newTool.Controls.Add(from);
    newTool.DefaultFloatingSize = from.Size;
 
    radDock1.AddDocument(newTool);
    radDock1.FloatWindow(newTool);
    radDock1.ActiveWindow = newTool;
 
    from.Show();
}

Please let me know if there is something else I can help you with.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
SPE
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or