1

I have an issue that on one computer applications developed using the Windows Presentation Foundation have my scrollwheel all inverted. I scroll 'upwards' and the control in question will go down. And vice versa. Other programs are not affected and scroll just fine.

I have searched a lot, but I can't seem to figure out what might be causing it. I am using W7 64-bit.

Things I have tried or might be useful to know...

  • creating an application using Winforms as well as a plain Win32 api. In those, when I scroll down, it scrolls down. All is well there.
  • I have also tried one of the affected applications (which I myself wrote) on my WXP 32-bit laptop. On that one, scrolling down indeed means scrolling down.
  • I use the standard Windows mouse driver. No fancy Logitech or other software installed that might be causing this.
  • This Windows installation is 2 months old or so. There is very little, if no cruft. I have no doubt that if I reinstalled, I'd manage to trigger it again. (I never had this issue before because prior to this I ran XP and avoided .NET like the plague.)

Anyone have any clue what setting is hiding where that's messing my WPF applications up like this?

Edit:

The following, when put on a populated listview, gives the correct message (down for down scroll, up for up scroll), yet it will still scroll in the wrong direction. What the hell?

private void listView1_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
{
    if (e.Delta < 0)
        textBox1.Text = "PREVIEW DOWN WE GO.";   // no we end up going up :(
    else
        textBox1.Text = "PREVIEW UP UP UP.";     // big letdown here.
}

(The plain MouseWheel event won't fire, hence the preview variety.)

Stigma
  • 1,686
  • 13
  • 27
  • I see this was migrated from Super User: do you have the source code for this program? At the beginning, you imply that it's just one WPF application, but at the end, you seem to indicate that there are multiple applications exhibiting this behavior. Is it reproducible in a brand new WPF app? – Cody Gray - on strike Nov 28 '10 at 15:18
  • Yeah I flagged the question on SU that it shouldn't be here. It is not specific to my app - it merely was the catalyst for me noticing the issue. All WPF-based programs I've tested with show this problem. (Simply adding a listview and adding items to it will cause the issue on the computer in question, for example.) I suspect there is some kind of global-ish WPF configuration spot that affects this; my personal guess is something touch-related since if it were to interpret it as a touch for some odd reason, the behaviour would make sense. – Stigma Nov 28 '10 at 16:02
  • Mistakes sometimes happen with migrations. If you really care about it flag this question for moderator attention and the migration history can be cleared. – ChrisF Nov 28 '10 at 16:41

2 Answers2

2

Holy crap, I just figured it out. It suddenly hit me.

I have me Mouse wheel set to 'scroll one screen at a time'. I never thought anything of it despite going over that window a dozen times looking for an 'invert scroll direction' option I might have checked.

Setting the setting to scroll a given number of lines per notch on my wheel fixes the scrolling, although I don't get my expected paging.

This is plain buggy coding on Microsoft's part. First I spend half a day searching the internet for TextOptions.TextFormattingMode="Display" so my forms don't look like total crap, then I spend a small eternity on another issue which thankfully had a simple setting suffice as well. And now this. Am I just hitting all those little roadbumps nobody else seems to hit or care much about? :/

(Apologies for answering my own question again, kind people. I've done it the last few questions despite searching for answers on the matter for hours. Ugh.)

Stigma
  • 1,686
  • 13
  • 27
1

There is absolutely no reason for this to happen. Have you tried running the problematic application on other computers.

basarat
  • 261,912
  • 58
  • 460
  • 511
  • Yes I have. As I said in the question: I have a Windows XP 32-bit laptop, and scrolling works just fine there. I only have the issue on my W7 64-bit machine. – Stigma Nov 28 '10 at 16:03
  • I have a windows 7 64 bit machine and it works fine and I am sure that microsoft tested this on a *lot* of devices. Have you tried writing your own wpf application and testing it on the W7 machine? – basarat Nov 28 '10 at 16:09
  • Yeah. I am digging into WPF development for the first time since the past week, and that is how I discovered this issue. Trying to exclude things, I tried other computers, other controls, other frameworks and even plain winapi. It's just WPF. I have amended my opening post with a test I just ran using the PreviewMouseWheel event. – Stigma Nov 28 '10 at 16:13