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

Flickering on MDI child creation

Hi,
I am using the Syncfusion Essential Studio 4.2;
Visual Studio 2005 and .NET 2.0

I am developing a MDI application, using Syncfusion's TabbedMDIManager and DockingManager. When I try to create a MDI child it behaves strange(The ui goes back and come front, and flickering). It happens in first child creation of the MDI form (but less effect in further children). It also happens while closing the application. How can we avoid this flickering.

Sample app can be found in the following message thread. http://www.syncfusion.com/support/Forums/message.aspx?&MessageID=59646

Regards,
Sekar

17 Replies

GR Golda Rebecal Syncfusion Team April 23, 2007 02:44 PM UTC

Hi Sekar,

I am able to reproduce the issue of flickering being seen whenever a mdi child is added to a form that is having the DockingManager.

This can be resolved by using LockHostFormUpdate and UnLockHostFormUpdate methods of the DockingManager before and after docking state transitions.

//To avoid flickering
this.dockingManager1.LockHostFormUpdate();
this.dockingManager1.DockControl(form, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Right, 0);
this.dockingManager1.SetAsMDIChild(form, true);
this.dockingManager1.SetControlSize(form, size);
this.dockingManager1.UnlockHostFormUpdate();

I have modified the sample you have given and attached it. Please have a look at it and let me know if this helps you.

Thanks for your interest in Syncfusion products.

Best regards,
Golda


SE Sekar April 24, 2007 09:52 AM UTC

Hi Golda,
Thanks for you reply.
It does not show any flickering, but there is a painting issue while creating a child (if it is first child of the app then the re-painting is
NOT happening for a long time). Also, while closing the MDI form, i need to dispose all the children; If i do so then closing the application also flickering happens.

How can i avoid the flickering and painting issue as well?

Have a look at the attached sample.
In that while adding the MDI child window, if i do the Docking style as Fill then it throws exception.

//this.dockingManager1.DockControl(form, this, Syncfusion.Windows.Forms.Tools.DockingStyle.Fill, 0);

Also, kindly guide me how to add a tabbed docking client in a best possible way

Regards,
Sekar

SyncMDIApp0.zip


GR Golda Rebecal Syncfusion Team April 24, 2007 01:13 PM UTC

Hi Sekar,

Issue 1: Painting issue when first MDI child form is added

I am looking into this issue.

Issue 2: Flickering occurs on closing the application

You can use the LockHostFormUpdate and UnLockHostFormUpdate methods of the DockingManager for this purpose.

this.dockingManager1.LockHostFormUpdate();
foreach (Control ctrl in dockedctrls)
{
this.dockingManager1.SetEnableDocking(ctrl, false);
ctrl.Dispose();
}
this.dockingManager1.UnlockHostFormUpdate();


Issue 3: Exception thrown when DockingStyle.Fill is used in the DockControl method of the DockingManager
I am afraid that I am not able to reproduce the issue at my end in v4.2.0.37. Could you please let me know whether you are using the same version?

Please have a look at the attached sample and let me know if you have any questions.

Thanks for your interest in Syncfusion products.

http://websamples.syncfusion.com/samples/tools.Windows/F59803_1/main.htm

Best regards,
Golda


SE Sekar April 24, 2007 03:56 PM UTC

#1. I have uncommented the tabbedMDIManager.DockControl method(with dockstyle as Fill). It throws the following exception when creating new mdi child.

System.ArgumentException: Docking control with DockingStyle.Fill to DockingManager's host control not allowed.
at Syncfusion.Windows.Forms.Tools.DockingManager.DockControl(Control ctrl, Control parent, DockingStyle dockstyle, Int32 nsize, Boolean tabGroup)
at Syncfusion.Windows.Forms.Tools.DockingManager.DockControl(Control ctrl, Control parent, DockingStyle dockstyle, Int32 nsize)
at SyncMDIApp.MainForm.newToolStripMenuItem_Click(Object sender, EventArgs e) in D:\Dhans\AMD\Samples\From Sync\SyncMDIApp2\SyncMDIApp\MainForm.cs:line 74
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(MA first chance exception of type 'System.ArgumentException' occurred in Syncfusion.Tools.Windows.dll
essage& m, Keys keyData)
at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
at System.Windows.Forms.ToolStripManager.ProcessCmdKey(Message& m, Keys keyData)
at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
at System.Windows.Forms.Control.ProcessCmdKey(Message& msg, Keys keyData)
at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FPreTranslateMessage(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SyncMDIApp.Program.Main() in D:\Dhans\AMD\Samples\From Sync\SyncMDIApp2\SyncMDIApp\Program.cs:line 19

#2. If I use the tabbedMDIManager.DockControl method(with dockstyle as Tabbed). It throws the following exception when making a mdi child as float.
A first chance exception of type 'System.NullReferenceException' occurred in Syncfusion.Tools.Windows.dll
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.Tools.DockHostController.set_FloatOnly(Boolean value)
at Syncfusion.Windows.Forms.Tools.DockingManager.SetFloatOnly(Control ctrl, Boolean bfloating)
at Syncfusion.Windows.Forms.Tools.DockingManager.MDIFormFloatingItem_Click(Object sender, EventArgs e)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.OnItemClicked(EventArgs args)
at Syncfusion.Windows.Forms.Tools.XPMenus.BarItem.PerformClick()
at Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid.NotifyItem(BarItem item)
at Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid.HidePopup(PopupCloseType popupCloseType)
at Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid.ProcessItemClick(BarItem item)
at Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid.OnMouseUp(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg)
at Syncfusion.Windows.Forms.Tools.XPMenus.MenuGrid.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at SyncMDIApp.Program.Main() in D:\Dhans\AMD\Samples\From Sync\SyncMDIApp2\SyncMDIApp\Program.cs:line 19

#3. What is the use of LockWindowUpdate() method provided in the sample?

Regards,
Sekar


SE Sekar April 25, 2007 08:10 AM UTC

Also,
In my application, when I try to create a new MDI child the application bounces (i.e. the screen goes back to Desktop and then shows the application with the child), but i could not reproduce it in the sample app.

How to avoid this?

Regards,
Sekar


GR Golda Rebecal Syncfusion Team April 25, 2007 02:53 PM UTC

Hi Sekar,

Issue 1) Exception is thrown while setting docked control as a MDI child if DockingStyle.Fill is used in DockControl method of the DockingManager

I am afraid that I am not able to reproduce the issue in 4.2.0.37. But I am able to reproduce the issue in v4.3 & v4.4. Could you please let me know whether you have installed any patches in v4.2? As a workaround, you can use the SetEnableDocking method of the DockingManager instead of the DockControl method.

Issue 2)When DockingStyle.Tabbed is used in DockControl method of the DockingManager, exception is thrown when a MDI child is made as Float.

Whenever DockingStyle.Tabbed is used, it should be tabbed inside another docked control. Here in your sample, you have given the host form as the parent control of the child form. That is the cause of this issue.

Issue 3) Screen bounces back to the desktop

Could you please provide the cs file that is having the issue so that we could analyze it?

Thanks for your interest in Syncfusion products.

Best regards,
Golda


SE Sekar April 26, 2007 04:29 PM UTC

Hi Golda,

[Syncfusion Version : 4.402.0.51]

I have reproduced the bouncing issue. Its happening when i use the MainFrameBarManager control along with the DockingManager control.

Let me know how to fix this as soon as possible. TREAT THIS AS A HIGH PRIORITY ISSUE

Regards,
Sekar

SyncMDIApp2.zip


BB Ben Bahrenburg April 26, 2007 09:09 PM UTC

I have a similar issue with the MDI form returning focus back to the desktop. In the 5.0 beta this doesn't seem to be as much of an issue. But due to another bug with the beta release I haven't been able to fully test this. Has anyone tried tested to see if the 5.0 beta fixes this issue?


BB Ben Bahrenburg April 26, 2007 10:03 PM UTC

Just checked the new RC1 and it looks like 5.x addresses the flicker on child close, but the app paint on child load ( appears to go back to the desktop ) still seems to be an issue.

Any tricks on stopping this?


GR Golda Rebecal Syncfusion Team April 27, 2007 06:11 AM UTC

Hi Ben,

I am able to reproduce the issue of MDI form returning focus back to desktop on child load when LockHostFormUpdate and UnlockHostFormUpdate methods of the DockingManager are used.

We can resolve this by using the LockHostFormUpdate and UnlockHostFormUpdate methods of the TabbedMDIManager.

I have modified the sample given above in this thread and attached it. I have also attached a video file that shows what I could see at my end. Please have a look at it and let me know if this helps you.

Thanks for your interest in Syncfusion products.

http://websamples.syncfusion.com/samples/tools.Windows/F59803_2/main.htm

Best regards,
Golda


SE Sekar April 27, 2007 07:13 AM UTC

Hi Golda,

I am using Syncfusion Version : 4.402.0.51

Still I have the follwing issues,

#1. Application controls are NOT Painting smoothly on loading

#2. Screen bounces back to Desktop on first MDI Child creation.

#3. Screen bounces back to Desktop on every MDI Child closing.

Regards,
Sekar


GR Golda Rebecal Syncfusion Team April 27, 2007 08:55 AM UTC

Hi Sekar,

I am able to reproduce these issues in v4.4. Could you please create a Direct-Trac incident with the subject line "Flickering on MDI child creation - F59803" so that we could give more details regarding the fix?

Thanks for your interest in Syncfusion products.

Best regards,
Golda




BB Ben Bahrenburg April 27, 2007 06:54 PM UTC

Hi Golda,

I've tried using

tabbedMDIManager.LockHostFormUpdate()
tabbedMDIManager.AttachToMdiContainer(Me)
MyForm.Show()
tabbedMDIManager.UnlockHostFormUpdate()

And still seem to have the issue on load. Does this only file the issue on close?


GR Golda Rebecal Syncfusion Team April 28, 2007 12:52 PM UTC

Hi Ben,

Could you please let me know whether you mean the flickering(screen goes back to the desktop) that occurs on first child load that is reproduced in the sample I have given above?

Thanks for your interest in Syncfusion products.

Best regards,
Golda


BB Ben Bahrenburg April 30, 2007 02:56 PM UTC

Hi,
It seems to be slightly noticeable in the sample. My project shows the issue since I have a large operation on the load of the child. The first time a child form is loaded it seems happens. I believe this is due to my child form having a dock control.

Is there anyway to stop the return to desktop, or to force a repaint of the child form to avoid the disappearing issue?


BB Ben Bahrenburg May 1, 2007 11:31 AM UTC

HI Golda ,
Just wondering if you where able to find another work around. The issue seems to be the refresh rate on the first load of a child form. If you have a long operation and a dock control on the child form it is even worse. The 5.0 release makes the flicker alittle better, but the return to desktop issue is still present.


GR Golda Rebecal Syncfusion Team May 1, 2007 12:10 PM UTC

Hi Ben,

Sorry for the delay in responding

"Flickering occurs and shows the background of the application when first child form is loaded" is a known issue and we have logged a bug report regarding this. Could you please create a Direct-Trac incident with the subject line "Flickering on MDI child creation- F59803" so that we could give more details regarding the fix?

Thanks for your interest in Syncfusion products.

Best regards,
Golda

Loader.
Live Chat Icon For mobile
Up arrow icon