Print Page | Close Window

markup + horizontal scrolling

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14899
Printed Date: 09 June 2024 at 7:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: markup + horizontal scrolling
Posted By: adrien
Subject: markup + horizontal scrolling
Date Posted: 03 August 2009 at 10:29pm
Hi all

I can get vertical scrolling working fine with a scrollview (?) element, but can't get any vertical scrolling. It doesn't matter what sort of child element is inside it.

I can understand if you've got a vertical stackpanel, but for anything that does not resize horizontally (or has min width) this means you can't scroll to view it all.

Is this a bug?

Adrien

-------------
http://www.wingate.com - http://www.wingate.com



Replies:
Posted By: Oleg
Date Posted: 06 August 2009 at 12:38am
Do you route events to markup with CXTPMarkupContext::OnWndMsg ?
 
BOOL CMarkupStatic::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
 // To Handle Hyperlinks:
 if (m_pUIElement)
 {
  CXTPMarkupContext::m_hContextWnd = m_hWnd;
  if (CXTPMarkupContext::OnWndMsg(m_pUIElement, message, wParam, lParam, pResult))
   return TRUE;
 }
 return CStatic::OnWndMsg(message, wParam, lParam, pResult);
}


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


Posted By: adrien
Date Posted: 06 August 2009 at 11:35am
this is even in MarkupPad. It scrolls vertically but clips horizontally. Can check with using MinWidth on something inside a scrollpanel.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: Oleg
Date Posted: 07 August 2009 at 4:08am
Hi,
Please paste XAML you tried.


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


Posted By: adrien
Date Posted: 07 August 2009 at 7:41pm
<Grid xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
TextElement.FontSize="14" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5">
     <Border>
          <ScrollViewer Width = "100" Height="100" Margin="4">
          <StackPanel Orientation="Horizontal" Background="Gold">
               <RadioButton Content="Item 1"/>
               <RadioButton Content="Item 2"/>
               <RadioButton Content="Item 3"/>
               <RadioButton Content="Item 4"/>
               <RadioButton Content="Item 5"/>
               <RadioButton Content="Item 6"/>
               <RadioButton Content="Item 7"/>
               <RadioButton Content="Item 8"/>
               <RadioButton Content="Item 9"/>
          </StackPanel>
          </ScrollViewer>     
     </Border>
</Grid>

I've never been able to do anything that will get a scrollpanel to display a horizontal scrollbar, only vertical.

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: jpbro
Date Posted: 09 August 2009 at 12:19pm
Add a HorizontalScrollBarVisibility='Auto' attribute to your ScrollViewer:


          <ScrollViewer Width = "100" Height="100" Margin="4" HorizontalScrollBarVisibility='Auto'>


And you should see the horizontal scrollbar.

On a semi-related note to CJ though - try using Adrien's XAML with my modification and you will see that the scroll thumb bitmap gets chopped off at the right edge (this happens when the thumb gets small due to wide objects in ScrollViewer). Any chance of a fix for this?


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

Language: Visual Basic 6.0 SP6



Posted By: adrien
Date Posted: 09 August 2009 at 6:42pm
thanks!

-------------
http://www.wingate.com - http://www.wingate.com


Posted By: adrien
Date Posted: 09 August 2009 at 7:48pm
Still some bugs in it.

Relating to TextBlock elements. If you have a large textblock, and put it inside a ScrollViewer, and set horizontal scrolling to auto, then the text block presumes it has infinite width, and won't wrap. It then forces any border around it to be too big etc.

I want to do some text that will always just wrap to the width of the actual screen it's in, but when the screen gets smaller than say 400px, it will start scrolling horizontally at that point.



-------------
http://www.wingate.com - http://www.wingate.com


Posted By: jpbro
Date Posted: 09 August 2009 at 8:02pm
I think you need to explicitly declare the width of your TextBox, and set the TextWrapping attribute to Wrap. If you put that in a ScrollViewer with the HorizontalScrollBarVisibility='Auto' attribute set, you will only see a horizontal scrollbar when the width of the Markup window < the width of your TextBox. Something like:


<ScrollViewer HorizontalScrollBarVisibility='Auto'>
    <TextBlock Width='400px' TextWrapping='Wrap'>
    This is a test of really long text to make sure that it wraps at 400px, but to also ensure that the horizontal scrollbar will not appear unless needed!
    </TextBlock>
</ScrollViewer>



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

Language: Visual Basic 6.0 SP6



Posted By: jpbro
Date Posted: 09 August 2009 at 11:41pm
Here's a sample image that shows the chopped scroll thumb problem:



This is a problem in Vista, seems okay in Win2K, not sure about XP (can anyone confirm for XP)?

Thanks.


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

Language: Visual Basic 6.0 SP6




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