Print Page | Close Window

MarkupScrollViewer horizontal scrolling

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: MarkupLabel Control
Forum Description: Topics Related to Codejock MarkupLabel Control
URL: http://forum.codejock.com/forum_posts.asp?TID=20064
Printed Date: 28 March 2024 at 9:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MarkupScrollViewer horizontal scrolling
Posted By: Andrew666
Subject: MarkupScrollViewer horizontal scrolling
Date Posted: 18 August 2012 at 7:55am
By default the MarkupScrollViewer object is displayed with a vertical scroll bar.  If the content will not fit horizontally it is simply truncated.  How can I programatically enable a horizontal scroll bar?  Thanks.



Replies:
Posted By: Xander75
Date Posted: 29 August 2012 at 3:26am
Hi,

I have used the following code in the ScrollViewer to show both the Horizontal & Vertical ScrollBars.

<ScrollViewer HorizontalScrollBarVisibility='Auto' VerticalScrollBarVisibility='Auto'>



-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: Andrew666
Date Posted: 10 September 2012 at 6:17am
I thought this was a straightforward "how to" question... clearly its more tricky.  Anyone?


Posted By: Andrew666
Date Posted: 06 October 2012 at 8:08am
Good news - there's a simple technique I've discovered to address this issue, that could be used to incorporate any XAML properties, even if they're not revealed programatically.
 
All you have to do is create the ScrollViewer in XAML first, making sure you give it a unique name, then create a MarkupScrollViewer object using MarkupUIElement.FindName.
 
For example, you would create the ScrollViewer using XAML like this:
 
<Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>
<ScrollViewer VerticalScrollBarVisibility='Auto' HorizontalScrollBarVisibility='Auto' Name='Scroller'></ScrollViewer></Page>
 
And assign this to the control Caption.
 
Then use this to get the ScrollViewer object:
 
Dim pScrollViewer As MarkupScrollViewer
Set pScrollViewer = Me.markupIcons.MarkupContext.CreateObject("ScrollViewer")
Set pScrollViewer = Me.markupIcons.MarkupUIElement.FindName("Scroller")
 
Now you can use the pScrollViewer object as before - but it will now be displayed with a horizontal scroll bar when this is necessary - something you can't reproduce purely from pScrollViewer properties.
 
Smile
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net