markup + horizontal scrolling |
Post Reply |
Author | |
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
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 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
this is even in MarkupPad. It scrolls vertically but clips horizontally. Can check with using MinWidth on something inside a scrollpanel.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Please paste XAML you tried.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
<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. |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
Add a HorizontalScrollBarVisibility='Auto' attribute to your ScrollViewer:
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 |
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
thanks!
|
|
adrien
Senior Member Joined: 30 April 2007 Location: New Zealand Status: Offline Points: 449 |
Post Options
Thanks(0)
|
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. |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
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:
|
|
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
|
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1354 |
Post Options
Thanks(0)
|
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 |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |