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

XPTaskBar Display Problems

Hi, I am having some display problems with the XPTaskBar. I know that the problems are caused by what I am trying to do but maybe you can suggest a better way to acheive the same result. Basically I have three XPTaskBarBox which fill the form. What I would like to happen is when the top or bottom XPTaskBarBox is collapsed the middle one is made larger so that the XPTaskBar still fills the form. The attached code achieves this, however there is some flickering during the collapse / expand of the top or bottom XPTaskBarBox. Thanks in advance, Nik

2 Replies

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

Live Chat Icon For mobile
Up arrow icon