Is there a way to get push to scroll functionality in Windows 8 metro Apps?

后端 未结 2 745
南方客
南方客 2021-01-22 20:13

In the Windows 8 Consumer Preview, moving the mouse towards the left or right edge in the start screen causes the content to scroll.

The standard controls (and currently

2条回答
  •  温柔的废话
    2021-01-22 21:08

    You can do the following to get information on mouse moving beyond the screen and use the delta information to scroll your content.

    using Windows.Devices.Input;
    
    var mouse = MouseDevice.GetForCurrentView();
    mouse.MouseMoved += mouse_MouseMoved;
    
    private void mouse_MouseMoved(MouseDevice sender, MouseEventArgs args)
    {
        tb.Text = args.MouseDelta.X.ToString();
    }
    

提交回复
热议问题