FloatingWindow Hide / Show

2 posts, 0 answers
  1. SPE
    SPE avatar
    34 posts
    Member since:
    Sep 2010

    Posted 03 Dec 2014 Link to this post

    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.
  2. Dimitar
    Admin
    Dimitar avatar
    1408 posts

    Posted 08 Dec 2014 Link to this post

    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.

     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top