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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

XPTaskBar Horizontal scroll

Thread ID:





94388 May 10,2010 09:51 PM UTC May 17,2010 07:37 AM UTC WinForms 6
Tags: Tools
Administrator [Syncfusion]
Asked On May 10, 2010 09:51 PM UTC

When I set the AutoScroll property of an XPTaskBar to true, I can geta vertical scrolbar to appear when one (or more) of the child XPTaskBarBox's is expanded beyond the visible area.

However, I can't seem to get a horizontal scrollbar to appear when controls within an XPTaskBarBox are covered up. Is there any way to do this?

Vallarasu S [Syncfusion]
Replied On May 11, 2010 07:03 AM UTC

Hi Mark,

Thanks for your interest in Syncfusion products.

Vertical scrollbar will be automatically added to the XPTaskBar,
But The horizontal scrollbar appears on setting the VerticalLayout property to 'True' and ColWidthOnHorizontalLayout property to large values.
this.xpTaskBar1.VerticalLayout = True;
this.xpTaskBar1.ColWidthOnHorizontalAlignment = 300;

Refer the sample in the following link which demonstrates the above.


Please let us know if you have any queries.

Vallarasu S.

Administrator [Syncfusion]
Replied On May 11, 2010 07:01 PM UTC

I'm finding that the horizontal scrollbar will appear when I set VerticalLayout to false.
But the problem is, I want the vertical layout. I don't want the boxes to ever be side by side (which they can be if VerticalLayout == false) but I do want a horizontal scroll if any of the items aren't in view.

Administrator [Syncfusion]
Replied On May 13, 2010 08:29 PM UTC

I've attached an image (zipped) that, hopefully, demonstrates the problem.
Again, the only way I can make the horizontal scrollbar to appear is if I set the VerticalLayout property to false but I don't want that because I do want the taskbarboxes to only layout vertically.

scrollbar problem_96137c2e.zip

Vallarasu S [Syncfusion]
Replied On May 14, 2010 05:10 AM UTC

Hi Mark,

Thanks for the details.

You can override the LayoutTaskBarBoxes method to get the XPTaskBar laid out as your requirement as follows:

protected override void LayoutTaskBarBoxes(int nTaskBarBoxesHeght)
int offset = 0;
if (BorderStyle == BorderStyle.Fixed3D)
offset = 4;
else if (BorderStyle == BorderStyle.Fixed3D)
offset = 2;
foreach (XPTaskBarBox taskMenuBox in this.Controls)
int nClientWidth = this.Width - this.DockPadding.Left- this.DockPadding.Right - offset;
int width = this.ColWidthOnHorizontalAlignment;
Size newSize = new Size(width, taskMenuBox.GetPreferredHeight());
newSize.Width = Math.Max(0,newSize.Width);
newSize.Height = Math.Max(0,newSize.Height);
if (newSize != taskMenuBox.Size)
taskMenuBox.Size = newSize;

Refer the sample in the following link which demonstrates the above.


Please let me know if it helps.

Vallarasu S.

Administrator [Syncfusion]
Replied On May 14, 2010 08:25 PM UTC

That's exactly what I was looking for.

Thank you very much!

Vallarasu S [Syncfusion]
Replied On May 17, 2010 07:37 AM UTC

Hi Mark,

Thanks for the update.
Glad to know that your requirement is achieved.

Vallarasu S.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon