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 8793463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:07:33+00:00 2026-06-13T23:07:33+00:00

How do I achieve this in a WinForms container control when the scroll bars

  • 0

How do I achieve this in a WinForms container control when the scroll bars are visible?

Highlighted here (Google Chrome browser):

enter image description here

EDIT: This cursor is the only one that is visible on a screenshot. I hope it’s clear what i mean.

EDIT:
Tried this on my control. Does not work.

    const int WM_MBUTTONDOWN = 0x207;
    protected override void WndProc(ref Message m)
    {
        if (m.Msg == WM_MBUTTONDOWN)
            DefWndProc(ref m);
        else
            base.WndProc(ref m);
    }
  • 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-13T23:07:34+00:00Added an answer on June 13, 2026 at 11:07 pm

    Here’s what I have so far. It exits “reader mode” if I release the middle button, and I haven’t implemented scrolling within the control (I used a textbox), but it may give you something to start with.

        [DllImport("comctl32.dll", SetLastError=true,  EntryPoint="#383")]
        static extern void DoReaderMode(ref READERMODEINFO prmi);
    
        public delegate bool TranslateDispatchCallbackDelegate(ref MSG lpmsg);
        public delegate bool ReaderScrollCallbackDelegate(ref READERMODEINFO prmi, int dx, int dy);
    
        [StructLayout(LayoutKind.Sequential)]
        public struct READERMODEINFO
        {
            public int cbSize;
            public IntPtr hwnd;
            public int fFlags;
            public IntPtr prc;
            public ReaderScrollCallbackDelegate pfnScroll;
            public TranslateDispatchCallbackDelegate fFlags2;
            public IntPtr lParam;
        }
    
        [StructLayout(LayoutKind.Sequential)]
        public struct MSG
        {
            public IntPtr hwnd;
            public UInt32 message;
            public IntPtr wParam;
            public IntPtr lParam;
            public UInt32 time;
            public POINT pt;
        }
    
        [StructLayout(LayoutKind.Sequential)]
        public struct POINT
        {
            public int x;
            public int y;
        }
    
        [StructLayout(LayoutKind.Sequential)]
        struct RECT
        {
            public int left, top, right, bottom;
        }
    
        private bool TranslateDispatchCallback(ref MSG lpMsg)
        {
            return false;
        }
        private bool ReaderScrollCallback(ref READERMODEINFO prmi, int dx, int dy)
        {
            // TODO: Scroll around within your control here
    
            return false;
        }
    
        private void EnterReaderMode()
        {
            READERMODEINFO readerInfo = new READERMODEINFO
            {
                hwnd = this.textBox1.Handle,
                fFlags = 0x00,
                prc = IntPtr.Zero,
                lParam = IntPtr.Zero,
                fFlags2 = new TranslateDispatchCallbackDelegate(this.TranslateDispatchCallback),
                pfnScroll = new ReaderScrollCallbackDelegate(this.ReaderScrollCallback)
            };
            readerInfo.cbSize = Marshal.SizeOf(readerInfo);
    
            DoReaderMode(ref readerInfo);
        }
    
        private void textBox1_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Middle)
            {
                EnterReaderMode();
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am using RichTextBox in a C#/Winforms application. Am showing some text in this control
In Winforms, I use Fill and Dock to achieve this. I have a Page
How can I achieve this view with CSS: ------------------TITLE or TITLE------------------ I have <div
I want to achieve this effect: When the user focus a text area within
I am trying to achieve this effect where a photo gets a repeating pattern
I'd like to achieve this result there are many tutorial around like this but
How can I achieve this behaviors onclick with jquery : default state: <a href=something.html>Anchor</a>
Can't seem to achieve this simple functionality! All I want is to clear a
I am trying to achieve this using Expression Blend 3. I need that every
I would like to achieve this functionality. <p:column> <p:commandLink value=prihlasit oncomplete=dlg.show(); action=#{signForProjectBean.setProjectForDetail(item)} /> </p:column>

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.