scrollviewer

Center a TextBox over the top of a ScrollViewer in WPF.

I have a MainView that contains a navigation bar which selects one of many XAML pages to be displayed in the page view pane. The MainView contains a ScrollViewer around the pages. This allows the pages to be whatever size they need to be and the MainView's ScrollViewer scrolls them. This all works great. On one of the pages, I need t...

Scrollbar Size in ScrollViewer

How can I programatically determine the width or height of a Scrollbar in the ScrollViewer? Not the current size based on the current state of the ScrollViewer (since I can simply test the visibility of the scrollbar and calculate against the ViewerPortWidth/Height and the ScrollViewer ActualWidth/Height). I need to know what size th...

Silverlight - use a ScrollViewer in a TextBox template

I'm trying to make a TextBox template and I need to include a ScrollViewer in the template - basically I want to add some content (like line numbers) that needs to scroll along with the normal text. The default template for the TextBox is like this: <Border x:Name="Border" BorderBrush="{TemplateBinding Border...

WPF WrapPanel / ItemsControl not scrolling.

I have a wrap panel displaying items but I cant get a scroll bar to work properly any idea's whats wrong ? <ScrollViewer> <ItemsControl Name="itemsControl"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapPanel ItemWidth="{Binding ElementName=sizeSlider, Path=Value}" ...

Is it possible to disable a ScrollViewer from inside the ScrollViewer?

From a UserControl, I would like to disable a ScrollViewer which is defined one level higher. My scenario looks something like this: <!-- ... --> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <custom:MyUserControl ... /> </ScrollViewer> Now, I would like to disable the Scr...

How can make ScrollViewer scroll when mouse is over *any* content

The reason I stress 'any' is because CanContentScroll is not fully working in my ScollViewer. Let me explain the scenario: I have a ScrollViewer that has three Labels followed by a ListBox each. The reason I have this content inside the ScrollViewer is because I don't want each ListBox to have a ScrollBar, I just want one "global" Scroll...

ScrollViewer doesn't fire MouseWheel event while Scrolling

The ScrollViewer's MouseWheel event will fire only when the scrollbar is at the end of it's track (either the top or bottom/left or right). The MouseWheel event does not fire when it's anywhere in between. Does anyone have any clue as to how to capture the scrolling when it's being caused by the mouse wheel? ...

Wpf binding to a function

I've a created a simple scrollviewer (pnlDayScroller) and want to have a separate horizontal scrollbar (associated scroller) to do the horizontal scrolling. All works with the below code accept I need to bind the visibility of the associated scroller. I can't simply bind this to the visibility property of the horizontal template part...

How can I check for child control clipping in a WPF ScrollViewer?

I'm trying to use the WPF ScrollViewer with a stackpanel containing buttons, and without the scrollbar. <ScrollViewer Grid.Row="1" Name="scrollViewer1" VerticalScrollBarVisibility="Hidden"> <StackPanel Name="stackPanel1"> <Button Content="Button1" Height="23" Name="button1" MinHeight="75" /> <Button ...

Silverlight 4: ToolTipService

I can't scroll to my scrollviewer, it disappear when I move the mouse. Was it because it was just a tooltip? If yes, is there a way to scroll the text in my tooltip? <TextBlock TextWrapping="Wrap" Style="{StaticResource TextBlockWidthStyle}" Text="{Binding ExtendedDescription}" ...

ScrollBars are not visible after changing positions of controls inside a Canvas

Hi, I created a custom canvas control inheriting from WPF Canvas. I am using it like this in main window - <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <RTD:RTDesignerCanvas Margin="5" Background="White" x:Name="canvas1" Focusable="True" Allow...

Scrolling a TextBlock

Hey everyone, I have a TextBlock and a Textbox in the same location. Depending on what mode the user is in, I make one visible and the other collapsed. This is working fine, but how can I make the Textblock scrollable? I figured I should use a ScrollViewer, but I don't know why it's not working. I've tried messing around with the heigh...

Silverlight scrollviewer for entire page not working

I have two pages with scrollviewers on them. One works fine, the other doesn't work at all and I don't know why. I'm hoping someone can help me understand what the second doesn't work. The first is this: <UserControl x:Class="DVCMaker.ViewPendingDVC" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http...

Scrollviewer Problem wpf

Hi All, I am displaying images inside the listbox. i have placed this listbox inside the scrollviewer. I am using two repeat button to move the listbox items. I am binding the listbox using datacontext. Problem: If i move the images using the button and click on the image in the lisbox it moves to the initial position. Code: <Rep...

WPF: Help with Scrollviewer MouseWheel Behavior

For some reason my scrollviewer does not process the mousewheel events (or at least scroll when you mouse wheel) when the mouse is over any child. I want it so that either when the mouse wheel is over the entire scrollviewer area, mousewheel scrolls. Either that or when you click on something contained in the scroller, it processes mou...

Listbox and scrollviewer wpf

Hi All, I want to display the list of songs in the listbox. Example. Song count 20. initially the listbox has to show 10 like song1 < song2 > song3 ... If we click the right arrow it has to show the next 10. Is it possible to achieve this. Geetha. ...

Overwriting custom event handler of as ScrollViewer

Hey guys I am trying to overwrite a event handler of MouseWheel for a ScrollViewer. Since ScrollViewer is sealed, I cant simply create a "custom" class inheriting it. I guess the generic question would be: "How do I overwrite the default event." (Or something like that ;-)) Edit: The event which should replace the default "scroll" only...

Problems with event bubbeling (ScrollViewer)

I have a problem with bubbeling events. I manage to bubble events in borders, grid, stackpanel, but not in a ScrollViewer If you look at the example below you will notice that when you click the TextBlock the event is bubbeled up to the Grid. But when I include the ScrollViewer the event stops here and is not sent up to the Grid. Does ...

Wrappanel and scrollviewer problem

Hi, I need to display buttons in which user can use to add controls. Buttons are categorized in groups. Here is the XAML I am having - <ScrollViewer VerticalScrollBarVisibility="Auto"> <GroupBox Name="maingroup" Header="Click To Add Controls" BorderBrush="Transparent"> <Grid> <Grid.Ro...

Binding to a ScrollViewer's ViewportWidth and ViewportHeight

I am using the Model-View-ViewModel architecture in a WPF application I am building, and I would like a specific ViewModel to actually be reactive to the size of the view (not a normal use-case of the MVVM approach, I know). Essentially, I have a ScrollViewer object and I want the viewmodel to observe the width and height of the scrollv...