scrollviewer

ScrollViewer not scrolling in WPF

可紊 提交于 2019-12-17 18:25:44
问题 I am using a scrollviewer control around my stack panel which contains an ItemsControl. When there are many items in the ItemsControl it is suppose to scroll but for some reason it just cuts of the items. Here is the code: <StackPanel> <ScrollViewer CanContentScroll="True" VerticalScrollBarVisibility="Visible"> <ItemsControl Name="icEvents" Width="Auto" Height="100" Background="AliceBlue" ItemsSource="{Binding Path=EventSources}"> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel>

ScrollViewer mouse wheel not working

浪尽此生 提交于 2019-12-17 17:53:22
问题 I am currently working on my first WPF project and trying to make a listview scrollable. At first I thought this could be easily done by simply limiting the listview's width and height and thus forcing a scrollbar to appear automatically whenever the content exceeds its space. This seemed fine at first but due to the handled PreviewMouseDown-Event (which enables dragging the list's items) it doesn't work after selecting an item. Second attempt (using ScrollViewer) <ScrollViewer> <ListView

WPF Remove ScrollViewer from TreeView

∥☆過路亽.° 提交于 2019-12-17 16:27:25
问题 I was wondering if it is possible to turn off the TreeView's ScrollViewer easily. I have a UserControl with a Grid. One of the Cells has a few TreeViews inside a Stackpanel. The height of the Control sizes automatically depending on the height of the TreeViews, so there is no need for a scrollbar. The problem is: I have a bunch of these in a ListBox with its own ScrollViewer, but when i am using the MouseWheel, scrolling stops when you are over a TreeView. This is because the TreeView has its

WPF - Animate ListBox.ScrollViewer.HorizontalOffset?

若如初见. 提交于 2019-12-17 15:41:35
问题 I have a collection of Visual s in a ListBox . I need to find the XPosition of an element inside it and then animate the HorizontalOffset of the ListBox 's ScrollViewer . Essentially I want to created an animated ScrollIntoView method. This gives me a couple of problems. Firstly, how can I get a reference to the ListBox s scrollviewer? Secondly, how can i get the relative XPosition or HozintalOfffset of an arbitrary element in the ListBox ? I'm not reponding to any input on the ListBox itself

WPF Image Pan, Zoom and Scroll with layers on a canvas

旧城冷巷雨未停 提交于 2019-12-17 02:46:46
问题 I'm hoping someone can help me out here. I'm building a WPF imaging application that takes live images from a camera allowing users to view the image, and subsequently highlight regions of interest (ROI) on that image. Information about the ROIs (width, height, location relative to a point on the image, etc) is then sent back to the camera, in effect telling/training the camera firmware where to look for things like barcodes, text, liquid levels, turns on a screw, etc. on the image). A

WPF Listbox wont scroll Vertical

早过忘川 提交于 2019-12-13 15:47:28
问题 Within a Groupbox I have a Listbox, ListboxItems are defined in the XAML as well. The Listbox is defined: <ListBox Name="lvAvoidCountry" Margin="5,5,5,5" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > Items are defined like this: <ListViewItem > <CheckBox Name="chkAlbanien" Tag="55"> <StackPanel Orientation="Horizontal"> <Image Source="images/flag_albania.png" Height="30"></Image> <TextBlock Text="Albanien"

Is it possible to adjust mouse wheel scroll distance on a WPF ScrollViewer?

爷,独闯天下 提交于 2019-12-13 15:39:23
问题 I find it is scrolling too much at a time when the mouse scroll wheel is used. I have a very short ScrollViewer (one line tall) that contains a few lines of items in a WrapPanel , and it is scrolling right to the bottom in one "tick" so that the middle line is never visible. 回答1: Not nice solution but you could add a few panes with text - one panel each line ScrollViewer class uses IScrollInfo interface and there are 2 methods. ((IScrollInfo)myPanel).LineUp();// and LineDown() Add a method to

ScrollViewer in Expander

≯℡__Kan透↙ 提交于 2019-12-13 05:22:51
问题 I have a ListBox with Expanders which in turn contains a ListBox. I would like to have both the ListBox with Expanders (listBox1) and the ListBox inside each Expander (listBox2) to have scroll functionality, but I cannot get the innermost scrolling to work (i.e. scrollViewer1 in my XAML). How can I get both scrollbars to work? <ScrollViewer x:Name="scrollViewer1"> <ListBox x:Name="listBox1" ItemsSource="{Binding Data}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Expander> <Expander

Silverlight DataGrid scrollbar synchronization

假装没事ソ 提交于 2019-12-13 04:04:36
问题 I have 2 Silverlight DataGrids one on top of another. I want to synchronize their horizontal scrollbars. I have tried to put them both in separate scrollviewers and set the horizontal offset of source scrollviewer to horizontal offset of target scrollviewer but that does not work, the below DataGrid scrollviewer disappers.I think that might be because these Datagrid are inside a StackPanel? I also tried to put these 2 grids in a third grid and apply scrollviewer on that but that does not work

ScrollViewer ContentScroll is missing

泄露秘密 提交于 2019-12-13 03:24:37
问题 my ScrollViewer doesn't work. scrolling isn't possible. <ScrollViewer> <StackPanel> <ListView> </ListView> <Grid> </Grid> <ListView> </ListView> </StackPanel> </ScrollViewer> i have tried different possibilities with setting of height (for ScrollViewer and StackPanel). how to scroll the content ? EDIT: VerticalScrollBarVisibility="Visible" and CanContentScroll="True" already used jeff 回答1: It's probably because you have your scrollviewer inside something like a stackpanel. Try a grid instead.