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

Enabled for Floating Windows

I have a main form; this has a docking manager that has several windows that can be docked and/or floated. I want to disable the main form and all of the docking manager''s forms. When I set the Enabled property on the main form, the UI interaction with its children should be disabled as well. The docked windows get disabled, but I am still able to interact with the floating windows. One way to fix this (and probably not the best) is to enumerate through the docking manager''s controls and individually set Enabled to false for each one. Is there a better way to do this?

1 Reply

AD Administrator Syncfusion Team February 13, 2004 11:33 AM UTC

Hi Melissa, Thanks for bringing this to our attention. I have tested for this issue here, and have observed that the floating windows are still active eventhough the HostForm is disabled. I have notified the development team in this regard, and we have logged a QA report #389 on this. Like you mentioned above, the only workaround that you could use is to iterate through the list of DockingManager''s Controls and disable all the floating windows. But please note that you cannot directly set the Control.Enabled property to false here. This is because the floating window is a slightly more complex structure than a docking window, consisting of 2 Containers within which the Control is embedded. In a floating window, the Control is hosted within a DockHost Container, and the the DockHost in turn is hosted within a FloatingForm (outer most Container). You should set the FloatingForm.Enabled to false to disable the floating window. Please refer to the code snippet below for this purpose : IEnumerator ienum = this.dockingManager1.Controls; ArrayList dockedctrls = new ArrayList(); while(ienum.MoveNext()) dockedctrls.Add(ienum.Current); foreach(Control ctrl in dockedctrls) { if (this.dockingManager1.IsFloating(ctrl)) { DockHost dhost = ctrl.Parent as DockHost; FloatingForm fform = dhost.ParentForm as FloatingForm; fform.Enabled = false; } } I have also attached the complete sample illustrating this here. Please let me know if you have any other questions. Regards, Guru Patwal Syncfusion, Inc.

Live Chat Icon For mobile
Up arrow icon