This is a migrated thread and some comments may be shown as answers.
Prevent Floating and Prevent Closing
1 Answer 68 Views
This is a migrated thread and some comments may be shown as answers.
Ching-Yen
Top achievements
Rank 1
Ching-Yen asked on 18 Jun 2008, 01:19 AM
Hi,

1. I have 3 pane in my project, and I would like to prevent them from Floating
2. For the other project, I would like to give the user the flexibility of making the pane floating, but, I do not want them have the option to close the pane.

Please advice.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 19 Jun 2008, 01:00 PM
Hello Ching-Yen,

Please find the answers to your questions below:

  1. In order to prevent your dock panels from floating, set dockingManager.AllowFloating to false.
  2. You can hide the close button of the floating window. To do that, you should first subscribe to the SizeChanged event of the corresponding DockPanel. Then, in the SizeChanged event handler, hide the close button:
    public Form1()  
    {  
        InitializeComponent();  
     
        dockPanel1.SizeChanged += new EventHandler(dockPanel1_SizeChanged);  
    }  
     
    void dockPanel1_SizeChanged(object sender, EventArgs e)  
    {  
        if (this.dockPanel1.DockState == DockState.Floating)  
        {  
            this.dockPanel1.FindForm().ControlBox = false;  
        }  
     
If you have additional questions, feel free to contact me.

All the best,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Dock
Asked by
Ching-Yen
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or