Print Page | Close Window

Markup Control ScrollViewer

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=12290
Printed Date: 07 July 2024 at 3:41pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Markup Control ScrollViewer
Posted By: jpbro
Subject: Markup Control ScrollViewer
Date Posted: 29 September 2008 at 4:50pm
I currently update a Markup controls caption using a timer. The XAML markup includes a ScrollViewer, and I would like to be able to get the thumb position of the scrollbar so that I can restore the position of the thumb after updating the content, otherwise if the user has scrolled away from the top of the page, the view gets reset to the top of the page after changing the Caption property.

Is there a way to get & set the position of a ScrollViewer thumb? If not, another option would be to set the VerticalScrollBarVisibilty attribute to Disabled and then roll my own scrollbar. But this would require the ability to get the Height of rendered XAML in the Markup control. Is there a way to do this?

To recap:

1) Is there a way to get & set the position of a ScrollViewer thumb in XAML?
2) Is there a way to get the rendered height of XAML in the Markup control?
3) If the answer to both of these questions is curently NO, is there any chance on either or both of these requirements to be implented?

Thanks in advance.



-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6




Replies:
Posted By: jpbro
Date Posted: 29 September 2008 at 4:54pm
Looking around the web, I found a VerticalOffset attribute, but it doesn't seem to be implented (plus I could set it, but I'm not sure if there is a way to get attribute values from the control).

I also have found an ExtentHeight & ViewportHeight properties, but again I don't know if there is a way to retrieve values from the Markup control.




-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 29 September 2008 at 5:05pm
Ok, last addendum. I see that you can use the MarkupContext property to create markup objects and then add then to the Markup control. Unfortunately, while many objects exist (like MarkupTextBlock, for example), there is no corresponding MarkupScrollViewer object. I guess I would need this to be able to programmatically interact with the ScrollViewer scrollbar.


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 30 September 2008 at 9:29am
Hi,
 
Thanks good points. Added for 12.1.
 
Here code for final release:
 
 
   Dim VerticalOffset As Long
  
   If (Not Me.MarkupLabel1.MarkupUIElement Is Nothing) Then
        VerticalOffset = Me.MarkupLabel1.MarkupUIElement.FindName("sv").VerticalOffset
   End If
  
  
  
   Me.MarkupLabel1.Caption = "<ScrollViewer Name='sv'><StackPanel>" & l_Text & "</StackPanel></ScrollViewer>"
  
   Me.MarkupLabel1.MarkupUIElement.FindName("sv").VerticalOffset = VerticalOffset


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: jpbro
Date Posted: 30 September 2008 at 10:29am
Excellent news Oleg! Thanks a lot...
Is there an updated beta that I can try?


-------------
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3

Language: Visual Basic 6.0 SP6



Posted By: Oleg
Date Posted: 30 September 2008 at 10:57am

Send email to mailto:support@codejock.com - support@codejock.com I will attach modified ocx to test.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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