I made a hiding bar into my application using a simple control, using a TranslateTransform.
When the bar is showed is overlapping a listbox.
What i didn't expect is that scrolling on the control don't prevent to scroll also the overlapped listbox.
I need that the listbox don't scroll when i'm working on the control.
I made a video in order to better explain the issue.
http://www.youtube.com/watch?v=9UM2lzPz8p0
[Update]
solved using UseOptimizedManipulationRouting="False"
Related
I've been messing around with making a messager using C# and PHP. Now I'm using a flow layout panel to show my messages using a custom user control.
When I update the messages I simply clear the controls and put them in again. Just simple.
The problem is that everytime the controls are getting cleared my scrollbar goes up. I don't want that. I want the scrollbar to stay at where it is. I know It's not possible with just using the scrollbar but how could I update my controls without clearing the list?
In my application user can scroll up/down MainWindow.
Problem is, that when a user scrolls down MainWindow and some controls in it are not entirely visible ( for example user scrolled down and only the bottom of the control is visible) these controls are not refreshing/updating its values (provided via binding). I suspect that WPF is detecting, that control is not visible in some way and does not bother to update UI of it. So how can I force these controls to update their UI?
For example, in picture below there is some chart in the MainWindow.But the window is small and scrolled down so the chart is not entirely visible. It does not update, it is still. When I maximize the window chart starts updating. I want it to update always, no matter how small part of it is visible:
This is a virtualization problem, and you need to turn off virtualization for your chart (look at the chart vendor's documentation).
In the standard WPF controls there are many ways to do this.
Using WinForms, C#...
I have a UserControl that contains a few panels.
When I programatically resize the panel, it causes the scroll bar to scroll to the top. I would like to prevent this as it is frustrating for the user to have the control scroll to the top.
I've tried to use "ScrollToControl()" after the resize bu this isnt practical as you still see the form jump and the once focused control is now at the bottom of the control.
Have tried to access the AutoScrollPosition but it returns 0. this.VerticalScroll.Value also returns 0 (where this is the user control before the resize event)
Any suggestions?
I have looked on stackoverflow and have not seen a solution (but may have missed it).
I want to scroll the datagridview contents with a swipe. A swipe gesture in Windows 8.1 seems to translate appropriately to a scroll event which causes the desired result. I can get the scroll event to show up if I have the scrollbar in the datagridview control. Consequently, to get scrolling to occur in the control with a swipe, I am looking for either (1) a way to have the scroll event occur without the scrollbar or (2) a way to hide the scrollbar. Option 1 is preferable since having the extraneous scrollbar around seems like a bit of a hack. I have a custom scrollbar outside of the datagridview which is why I want to hide the internal datagridview scrollbar.
Thanks for looking and any help you can provide.
I have a ListBox that contains two columns - column one contains a Toggle Button, column two contains an Expander with multiple controls within it. If the expander is collapsed, the overall scrolling of the ListBox works fine. However, if the Expander is open and the expander contains a large quantity of items, the ListBox will scroll the entire row size, often not showing part of the expander list.
This would be similar to placing an image in the list box that is larger than the viewable area of the list box. In this case, if you click the scrollbar, you would want to "step" down the image, without it scrolling off the screen in one click.
Is there a setting for the ListBox that will allow the partial scrolling as I've described? My listBox is defined in a xaml, the controls are added via C# code.
Have you tried turning on smooth scrolling by setting ScrollViewer.CanContentScroll to false? This is what controls whether the ScrollViewer will scroll an item at a time, or smoothly with partial items available.
"ScrollViewer currently allows two scrolling modes: smooth
pixel-by-pixel scrolling (CanContentScroll = false) or discrete
item-by-item scrolling (CanContentScroll = true). Currently WPF
supports UI virtualization only when scrolling by item. Pixel-based
scrolling is also called 'physical scrolling' and item-based scrolling
is also called 'logical scrolling'."
(From this answer).
If you have a lot of items in your ListBox, this may not be an ideal solution, however, because it turns off Virtualization, and therefore may have a performance impact. Take a look at this answer to see more about smooth scrolling and virtualization. (One answer suggests a hack that allows for smooth scrolling and virtualization).