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.
Unfortunately, activation email could not send to your email. Please try again.

Docking Manager

Thread ID:

Created:

Updated:

Platform:

Replies:

39698 Jan 16,2006 01:24 PM Jan 17,2006 11:50 PM Windows Forms 3
loading
Tags: Tools
Administrator [Syncfusion]
Asked On January 16, 2006 01:24 PM

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

Vijayanand S [Syncfusion]
Replied On January 17, 2006 01:07 AM

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

Administrator [Syncfusion]
Replied On January 17, 2006 02:24 PM

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

Vijayanand S [Syncfusion]
Replied On January 17, 2006 11:50 PM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;