scrollviewer

How to get Listbox item from the listbox wpf

Hi All, I want to scroll the listbox which is placed inside the srollviewer according to its selection. ListBoxItem item = (ListBoxItem)(lbTrack.ItemContainerGenerator.ContainerFromItem(lbTrack.Items.CurrentItem)); // ListBoxItem item = (ListBoxItem)(lbTrack.ItemContainerGenerator.ContainerFromItem(lbTrack.SelectedItem)); ...

WPF Button text wrap as far as possible and then scroll

As its container's width shrinks, I'm trying to get Button 1 to wrap its text until it can no longer do so, at which point the horizontal scrollbar kicks in. Right now, the button recognizes that it's got plenty of space due to the scrollviewer and doesn't wrap at all. <ScrollViewer HorizontalScrollBarVisibility="Auto"> <Grid> <...

Silverlight canvas scrollbars

I have read that placing a canvas inside a scrollviewer won't work because the canvas does not report its size. I have been experimenting with different containers (borders, grids, canvases and scrollviewers) and could really do with a simple explanation of how scrollviewers behave within nested containers. e.g. If I have a container h...

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

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. ...

WPF: ListBox or other Items Control in a ScrollViewer

We have a form that contains various elements and a datagrid. When the list box is contained in a scroll viewer, all is well when we increase the size of the window. When the window size is decreased the list box remains the same height and the vertical scrollbar becomes active. If you get rid of the height binding on the list box, the l...

Silverlight TreeView ScrollViewer Issue

Hey SO, got a question about the TreeView control in Silverlight. I have an application which dynamically adds elements to a treeview. Some of the elements are long enough to require horizontal scrolling. When they are added to the treeview, my treeview remains correctly all the way scrolled left so you have to scroll to see the end of ...

WPF Design view in Visual Studio 2010--scroll the scrollbar?

I just added a ScrollViewer to my WPF app. Now some of my content is hidden because it is at the bottom of the ScrollViewer--this is intentional. However, is there any way in the Design view of Visual Studio 2010 to scroll a scrollbar so that I can preview what my app looks like when the scrollbar is at different positions? It would b...

WPF/XAML Custom ScrollViewer ScrollBar w/o Custom ScrollBar in Inner Controls (like TextBox)

Hello, and thank you for looking into my question. I would like to customize the ScrollBar in my ScrollViewer. No problem. But wait. When I do that, it also changes the ScrollBar of the inner controls. I don't want to impact those ScrollBars. How do I specify the correct scope? Here's the XAML that almost works: <Page xmlns="http://s...

How do I replace a ScrollViewer with a ContentPresenter on a ListBox?

According to a post at the very end of this thread you can replace the ScrollViewer of a ListBox with a ContentPresenter to disable scrolling in a nested scenario. However, I don't know how to replace the ScrollViewer. Do I have to re-create the template? ...

WPF: TextBox resizes inside ScrollViewer

I have a TextBox that stretches to the width of the window: <Window ...> <TextBox VerticalAlignment="Top" /> </Window> However, the textbox should have a minimum width, and I want scroll bars to be shown, if the textbox cannot be displayed fully. Thus: <Window ...> <ScrollViewer HorizontalScrollBarVisibility="Auto"> <...

ScrollViewer in StackPanel

<StackPanel Name="mypanel"> <ScrollViewer Height="{Binding ElementName=mypanel, Path=ActualHeight}"> I need, that Height = mypanel.ActualHeight-60. How to do it? ...

WPF Remove ScrollViewer from TreeView

I was wondeirng if its possible to turn off the treeview's scrollviewer easily. I have a user controil with a grid and one of the cells has a few treeviews inside of 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...

Performance issues with the ScrollViewer

There seems to be a performance degradation when an items collection control is decorated with a ScrollViewer. In the particular application I am working on, there seems to be a big hit to the application when I decorate a VirtualizingStackPanel with a ScrollViewer. I am trying to load up 250 items in this particular container with the h...

Silverlight ScrollViewer takes focus when scrollbars are not visible.

I'm finding that Silverlight's ScrollViewer will still take focus even when the scrollbars are not visible. Has anyone else seen this issue? Are there any workarounds that will prevent the ScrollViewer acting as a tabstop when the scrollbars are invisible? Thanks, ...

WPF ScrollViewer - Align Horizontal Scrollbar to top?

Hello! I am wondering if it is possible to dock the horizontal Scrollbar in the ScrollViewer control to the top rather than have it on the bottom? If not, would it be possible to use a whole separate Scrollbar control placed above the ScrollViewer and somehow assign the ScrollBar_Scroll events to it? Thanks in advance! ...

WPF: Srollviewer not working in Items control.

I have a itemscontrol under scrollviewer. and under this items control I have another Usercontrol with items control under scroll viewer. something like this: scrollviewer itemscontrol .... /itemscontrol /scrollviewer under the above itemscontrol there is a usercontrol having: scrollviewer itemscontrol .... /itemscontrol /scrollviewer...

Silverlight - scrollbars resize problem while scaling scrollbarview content

I'm having strange problem with silverlight zoom and pan feature. I'm having scrollviewer, inside him border, and inside border my main content (some grids, text boxs etc..) My XAML is looking something like this : XAML : <Grid x:Name="Root" Background="Black"> <ScrollViewer x:Name="Scroller" HorizontalScrollBarVisibility="Visible...

How to prevent ScrollViewer from using MouseWheel event...

Hi! I'm building SL application for zooming and panning across the layout. Everything is working fine, except that when I zoom in using mouse wheel , after some zoom scrollbars start to use mouse wheel so after that I can scroll not zoom. I only can zoom again if I put scrollbars at the end or begining. How to prevent scrollviewer from ...

scrollviewer and canvas - scrolling view to given position

Hi I have some problems with implementing autoscrolling in WPF (I think I could call it that way). I have a canvas placed inside a scrollviwer. On my canvas I can dynamicly add different shapes. The position of this shapes can be changed with mouse. Everytime I add new shape on canvas or change position of shape I fire measureOverride fu...

WPF - ScrollViewer - how to enable horizontal scrolling with mouse

Hello, i cant find how to set scrollbar to scroll horizontaly with mouse. Vertical scrolling works good allways, but i need to scroll my content horizontaly. My code looks like this: <ListBox x:Name="receiptList" Margin="5,0" Grid.Row="1" ItemTemplate="{StaticResource...