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

  • SEARCH
  • Home
  • 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 8136677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:50:16+00:00 2026-06-06T10:50:16+00:00

The use of shift + scroll wheel is fairly common for horizontal scrolling. Both

  • 0

The use of shift + scroll wheel is fairly common for horizontal scrolling.

Both of those are fairly easy to capture. I can use the MouseWheel event with a flag set by the KeyDown, KeyUp events to keep track of when the shift key is pressed.

However, how do I actually trigger the horizontal scrolling? I am aware of WM_MOUSEHWHEEL, can that be used to trigger the event?

Update:
For a System.Windows.Form there is a HorizontalScroll property that is of type HScrollProperties. You can manipulate the Value attribute on that object to change the horizontal scrollbar’s position. However, so far I haven’t spotted any other controls on which that object is available.

  • 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-06T10:50:17+00:00Added an answer on June 6, 2026 at 10:50 am

    If you are creating your own control derived from UserControl or ScrollControl or Form, you can use this simple solution:

    protected override void OnMouseWheel(MouseEventArgs e)
    {
        if (this.VScroll && (Control.ModifierKeys & Keys.Shift) == Keys.Shift)
        {
            this.VScroll = false;
            base.OnMouseWheel(e);
            this.VScroll = true;
        }
        else
        {
            base.OnMouseWheel(e);
        }
    }
    

    Explanation

    If a control has AutoScroll and is displaying scrollbars, when you scroll the mouse wheel you will get the following behaviour:

    1. If no scrollbars are enabled, it does nothing.
    2. If only vertical scrollbar is enabled, it scrolls vertical scrollbar.
    3. If only horizontal scrollbar is enabled, it scrolls horizontal scrollbar.
    4. If both vertical and horizontal scrollbars are enabled, it scrolls vertical scrollbar.

    Noticing this behaviour, I figured out this hack to override OnMouseWheel of the control, then if the vertical scrollbar is enabled and Shift is held down, it disables the vertical scrollbar before calling base.OnMouseWheel. This will trick the control in scrolling the horizontal scrollbar (behaviour 3 as shown above).

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

Sidebar

Related Questions

Is there an easy way to use UIElement.Effect in WPF to shift the color
I know you can use CTRL , ALT , SHIFT , etc. modifiers for
In TextMate , one can use ctrl-shift-w to wrap text in an Open/Close tag
In Eclipse, you can use Ctrl + Shift + T to search for a
so far i only know to use Ctrl-Shift-A to do SVN in TextMate. is
I use the Eclipse keyboard shortcut Ctrl + Shift + O all the time
I use emacs 24 (OSX) and have a problem with shift-selection. If I select
I find it useful and productive to use the built in Ctrl + Shift
I want to use shift-tab for auto completion and shifting code blocks visually. I
When you hold shift and scroll with your mouse on a mac, it interprets

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.