RP
Ramesh Praveen
Syncfusion Team
February 14, 2003 12:12 PM UTC
Nik,
The flicker happens because the child Panel gets sized first and then positioned. To avoid this try this approach:
// Use this class instead of the XPTaskBar and set the childPanel (which flickers) field in the form's constructor.
public class MyTaskBar : Syncfusion.Windows.Forms.Tools.XPTaskBar
{
public Panel childPanel = null;
protected override void OnLayout(LayoutEventArgs levent)
{
// Suspend child Panel layout until layout is done.
if(childPanel != null)
childPanel.SuspendLayout();
base.OnLayout(levent);
if(childPanel != null)
childPanel.ResumeLayout(true);
}
}
// Use this custom panel. Another way to avoid flicker.
public class MyPanel : Panel
{
public MyPanel()
{
// To prevent automatic redraw when the control gets resized (this reduces flicker).
this.SetStyle(ControlStyles.ResizeRedraw, false);
}
}
NV
Nik Vale
February 14, 2003 05:57 PM UTC
Praveen,
Thanks for your suggestions. I tried them out and they helped a little with the flickering.
Calling SuspendLayout() on the child panels helps, however the XPTaskBarBox still get's resized even if I call SuspendLayout() on that too.
The flickering happens when the XPTaskBarBox's Size property is updated, and also when "LayoutContainer()" is called on the "flowLayout" object.
Thanks in advance,
Nik