Disable Bouncing When Swiping the Scroll on a Win8 Tablet

Asked 1 years ago, Updated 1 years ago, 84 views

On a Win8 tablet, swiping through a window with a vertical scroll bar causes the window itself to bounce (hit something?).

As this made me feel depressed, I would like to disable it in the application (.Net 4.5 environment/WPF) under development.
https://msdn.microsoft.com/ja-jp/library/ie/hh920761%28v=vs.85%29.aspx
css-controllable items

Bounce when the scrolled area reaches the edge

Is it possible to provide this function in WPF or Windows form?

c# wpf winforms

2022-09-30 19:08

2 Answers

If you simply want to disable the bouncing effect, WPF would be the fastest way to handle ManipulationBoundaryFeedback events such as ListBox.

public partial class MainWindow:Window
{
    public MainWindow()
    {
        InitializeComponent();

        list1.ManipulationBoundaryFeedback+=list1_ManipulationBoundaryFeedback;
    }

    void list1_ManipulationBoundaryFeedback(object sender,ManipulationBoundaryFeedbackEventArgse)
    {
        e.Handled = true;
    }
}

Note:
UIElement.ManipulationBoundaryFeedback Event (System.Windows)
https://msdn.microsoft.com/ja-jp/library/system.windows.uielement.manipulationboundaryfeedback.aspx
Series: Introduction to WPF: Learn the 10th WPF Input Events and Animation (1/2) - @IT
http://www.atmarkit.co.jp/ait/articles/1103/01/news124.html


2022-09-30 19:08

Simply put, ignoring WM_GESTURE in WndProc will not cause border-area feedback".However, this alone disables all gestures, so you must retrieve the GESTUREINFO structure from lParam to verify the status.

I didn't try it because there was no definition of GESTUREINFO on p/invoke.net, but according to MSDN, you can make a decision by checking GID_PAN or GF_BEGIN.


2022-09-30 19:08

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.