XPTaskBar Horizontal scroll

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?

6 Replies

VS Vallarasu S Syncfusion Team 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.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Taskbar-1816204238.zip

Please let us know if you have any queries.

Regards
Vallarasu S.


AD Administrator Syncfusion Team 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.


AD Administrator Syncfusion Team 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


VS Vallarasu S Syncfusion Team 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.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=Taskbar-38748844.zip

Please let me know if it helps.

Regards
Vallarasu S.


AD Administrator Syncfusion Team May 14, 2010 08:25 PM UTC

Nice!
That's exactly what I was looking for.

Thank you very much!



VS Vallarasu S Syncfusion Team May 17, 2010 07:37 AM UTC

Hi Mark,

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

Regards
Vallarasu S.

Loader.
Up arrow icon