We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Docking Manager

When I launch a form that uses a docking manager from another form and close them quickly, it causes the app to crash (see attached solution). Any ideas?

WindowsApplication22.zip

3 Replies

VS Vijayanand S Syncfusion Team January 17, 2006 06:07 AM UTC

Hi Will, You could use the following code in the Form2 closing event to dispose the docking manager while closing the form: IEnumerator ienum = this.dockingManager1.Controls; ArrayList dockedctrls = new ArrayList(); while(ienum.MoveNext()) dockedctrls.Add(ienum.Current); foreach(Control ctrl in dockedctrls) { this .dockingManager1.SetEnableDocking(ctrl, false); ctrl.Dispose(); } this.dockingManager1.Dispose(); This application crashing issue is caused by improper disposing of docking manager. I hope this resolves your problem and let me know if you have any questions. Thanks for using Syncfusion Products. Regards, Vijay


AD Administrator Syncfusion Team January 17, 2006 07:24 PM UTC

Hi, I inserted the code into the Dispose method and it works for the case I described earlier. However, now if I pin the docked control, then unpin the docked control and close the app I get an exception (see attached zip file for project and exception - exception.bmp). Any help you can give me will be greatly appreciated. Thanks, Will >Hi Will, > >You could use the following code in the Form2 closing event to dispose the docking manager while closing the form: > > >IEnumerator ienum = this.dockingManager1.Controls; > ArrayList dockedctrls = new ArrayList(); > > while(ienum.MoveNext()) > dockedctrls.Add(ienum.Current); > > foreach(Control ctrl in dockedctrls) > { > this .dockingManager1.SetEnableDocking(ctrl, false); > ctrl.Dispose(); > } > > this.dockingManager1.Dispose(); > > >This application crashing issue is caused by improper disposing of docking manager. I hope this resolves your problem and let me know if you have any questions. > >Thanks for using Syncfusion Products. > >Regards, >Vijay

WindowsApplication23.zip


VS Vijayanand S Syncfusion Team January 18, 2006 04:50 AM UTC

Hi Will, I was able to see the issue. You have inserted the code to dispose docking manager in Dispose method. But you should call the dispose method in form1 or form2 as follows: Form1: private void button1_Click(object sender, EventArgs e) { Form2 test = new Form2(); test.ShowDialog(); test.Dispose(); //It disposes the docking manager properly } Form2: private void Form2_Closing(object sender, System.ComponentModel.CancelEventArgs e) { IEnumerator ienum = this.dockingManager1.Controls; ArrayList dockedctrls = new ArrayList(); while(ienum.MoveNext()) dockedctrls.Add(ienum.Current); foreach(Control ctrl in dockedctrls) { this .dockingManager1.SetEnableDocking(ctrl, false); ctrl.Dispose(); } this.dockingManager1.Dispose(); } Please take a look at the modified sample and let me know if you are able to see the exception. If so, could you please let me know the Essential Studio and OS version which currently you are using now? Thanks Vijay

f39698.zip

Loader.
Live Chat Icon For mobile
Up arrow icon