scrollviewer

WPF ScrollViewer around DataGrid affects column width

爷,独闯天下 提交于 2019-11-27 14:24:19
I have a problem with a ScrollViewer that I use to scroll a user control that contains a data grid. Without the scroll viewer the columns fill the data grid as I want but when adding a scroll viewer the columns shrink to ~15px. I was able to simplify my layout and can still reproduce this behaviour. When binding the datagrid width to another control the columns have their normal with, but that has unsuprisingly the same effect as a fixed width on the datagrid. I guess I'm not the first one who has this problem. How can I work around this behaviour to have my grid adjusting its size to the

How to increase scrollbar width in WPF ScrollViewer?

删除回忆录丶 提交于 2019-11-27 12:21:28
I am working on a touch screen on a small device and the custom width of the scroll-bar is no good as one of my requirements is that everything needs to be doable by finger gestures. How can I set the width of the WPF ScrollViewer scrollbar? Note that I don't wanna change the width of all the scrollbars on the device (doable through windows settings) - only the ones in my app. Kent Boogaart The ScrollBar template reaches out for system parameters to determine its width/height (depending on orientation). Therefore, you can override those parameters: <ScrollViewer> <ScrollViewer.Resources> <sys

How can I get a vertical scrollbar in my ListBox?

雨燕双飞 提交于 2019-11-27 11:50:54
问题 In the example below I have a ListBox with dozens of font names in it. I would have thought it would automatically have a vertical scrollbar on it so that you can select ANY font, not just the first ones in the list, but it doesn't. So I added a "ScrollViewer" and that puts a "scrollbar area" on the right but there is no scrollbar in the scrollbar area so that you can scroll (!). Why isn't a scrollbar automatic and how do I force it to have a scrollbar? <StackPanel Name="stack1"> <Grid> <Grid

WPF: ItemsControl with scrollbar (ScrollViewer)

时光总嘲笑我的痴心妄想 提交于 2019-11-27 11:16:05
I followed this small "tutorial" on how to add a scrollbar to an ItemsControl, and it works in Designer view, but not when I compile and execute the program (only the first few items show up, and no scrollbar to view more - even when VerticalScrollbarVisibility is set to "Visible" instead of "Auto"). Any idea on how to solve this? This is the code I use to show my items (normally I work with Databinding, but to see the items in my Designer I added them manually): <ItemsControl x:Name="itemCtrl" Style="{DynamicResource UsersControlStyle}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate>

Animated (Smooth) scrolling on ScrollViewer

强颜欢笑 提交于 2019-11-27 09:51:58
问题 I have a ScrollViewer in my WPF App, and I want it to have smooth/animated scrolling effect just like Firefox has (if you know what I am talking about). I tried to search over the internet, and the only thing I've found is this: How To Create An Animated ScrollViewer (or ListBox) in WPF It works pretty good, but I have one problem with it - it animates the scrolling effect but the ScrollViewer 's Thumb goes directly to the point pressed - I want it to be animated aswell How can I cause the

How to use ScrollViewer.ScrollToVerticalOffset?

江枫思渺然 提交于 2019-11-27 09:19:57
I hope this isn't a duplicate but I can't find any documentation or examples on how to actually use ScrollToVerticalOffset() . I'm using it in a Windows Phone 8 app, but I think it will still apply to WP7 and Silverlight (although, feel free to correct me if I'm wrong). So here is my basic set up (pseudo-code from memory): <phone.PivotItem> <ScrollViewer> <Grid Height="1500"> <Grid.RowDefinitions> <!-- about 20 rows, all auto-height --> </Grid.RowDefinitions> <Border Grid.Row="0"> <TextBox x:Name="txt1" /> </Border> <Border Grid.Row="1"> <TextBox x:Name="txt2" /> </Border> <!-- ...... -->

Child elements of scrollviewer preventing scrolling with mouse wheel?

只愿长相守 提交于 2019-11-27 07:35:31
I'm having a problem getting mouse wheel scrolling to work in the following XAML, which I have simplified for clarity: <ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" CanContentScroll="False" > <Grid MouseDown="Editor_MouseDown" MouseUp="Editor_MouseUp" MouseMove="Editor_MouseMove" Focusable="False" > <Grid.Resources> <DataTemplate DataType="{x:Type local:DataFieldModel}" > <Grid Margin="0,2,2,2" > <TextBox Cursor="IBeam" MouseDown="TextBox_MouseDown" MouseUp="TextBox_MouseUp" MouseMove="TextBox_MouseMove" /> </Grid> </DataTemplate> </Grid.Resources>

How to disable ScrollViewer in ListBox?

限于喜欢 提交于 2019-11-27 06:49:54
问题 I have a ListBox. It has internal ScrollViewer, so I can scroll ListBox content with mouse wheel. It works fine until I set item template that contains another ListBox (in fact, I have 4 nested ListBoxes =)). Problem is that internal ListBox's ScrollViewer steals wheeling event. Is there any easy way to prevent this behavior? I had ListBox with ItemContainerStyle like this: <Style x:Key="ListBoxItemStyle" TargetType="{x:Type ListBoxItem}"> <Setter Property="BorderBrush" Value="Black"/> ... <

Zooming To Mouse Point With ScrollView and ViewBox in Wpf

烈酒焚心 提交于 2019-11-27 06:24:57
问题 I have some paths drawn to the screen in wpf. The coordinates being used are quite small so they have been made to fill the screen with a view box. I am now trying to implement pan and zoom functionality. I would like to be able to zoom to wherever the mouse is in relation to the ui (i.e zoomed screen center is equal to mouse coordinates). The current outcome is that the center of the screen when zoomed is not reflective of the exact mouse position on the ui. If you want to see what is

Slider \ ScrollViewer in a touch interface not working properly

北城余情 提交于 2019-11-27 06:16:13
问题 In WPF I've got the following XAML: <ScrollViewer Canvas.Left="2266" Canvas.Top="428" Height="378" Name="scrollViewer1" Width="728" PanningMode="VerticalOnly" PanningRatio="2"> <Canvas Height="1732.593" Width="507.667"> <Slider Height="40.668" x:Name="slider1" Width="507.667" Style="{DynamicResource SliderStyle1}" Canvas.Left="15" Canvas.Top="150" /> </Slider> </Canvas> </ScrollViewer> It's a ScrollViewer containing a Slider. I'm using the following on a touch-screen, and I'm using the