Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7863809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:36:01+00:00 2026-06-02T23:36:01+00:00

Im using a WPF ScrollViewer to host some controls. I’d really like it to

  • 0

Im using a WPF ScrollViewer to host some controls. I’d really like it to interact like on a touch device where it slowly eases back into place when you pull it too far.

It doesn’t have a scrollbar – I have manual mouse scrolling with click and drag using this code:

Point currentPoint = e.GetPosition(this);

// Determine the new amount to scroll.
Point delta = new Point(scrollStartPoint.X - currentPoint.X, scrollStartPoint.Y - currentPoint.Y);

if (Math.Abs(delta.X) < PixelsToMoveToBeConsideredScroll &&
    Math.Abs(delta.Y) < PixelsToMoveToBeConsideredScroll)
    return;

scrollTarget.X = scrollStartOffset.X + delta.X;
scrollTarget.Y = scrollStartOffset.Y + delta.Y;

// Scroll to the new position.
sv.ScrollToHorizontalOffset(scrollTarget.X);
sv.ScrollToVerticalOffset(scrollTarget.Y);

Is there an easy way to do this? Currently it just acts like a normal scrolling textbox and will neither pull outside its normal range, nor slowly ease back.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:36:02+00:00Added an answer on June 2, 2026 at 11:36 pm

    If you are working on a Touch device, look at the Microsoft SurfaceScrollViewer (http://msdn.microsoft.com/en-us/library/microsoft.surface.presentation.controls.surfacescrollviewer.aspx). It already has this behaviour built in.

    Getting Touch interaction right is tricky, easier to find someone else who’s already done it. 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Occasionally I'll have some WPF C# code that I'd like to write in a
I am working on a WPF application and using a scrollViewer to view the
I am using a ScrollViewer in WPF. My XAML is as follows :: <ScrollViewer
using WPF/C#/Entity Framework. I have a DataGrid.ItemsSource bound to some ObservableCollection . Now, I
I'm trying to skin a ScrollViewer in WPF using XAML but have been faced
I'm creating some desktop application using WPF(C# .net). I want to create it as
I have a data entry form in WPF built using a Scrollviewer with various
Using WPF .NET 4.0 in VS2010 RTM: I can't create a fullscreen WPF popup.
(using WPF application) I get an error when i want to save a bool
I have been using WPF for a few years now and don't have any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.