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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:50:11+00:00 2026-06-12T05:50:11+00:00

I have a RichTextBox with ScrollBars set to None. According to MSDN The DefWindowProc

  • 0

I have a RichTextBox with ScrollBars set to None. According to MSDN

The DefWindowProc function propagates the message to the window’s
parent. There should be no internal forwarding of the message, since
DefWindowProc propagates it up the parent chain until it finds a
window that processes it.

I interpret this as, I should not need to hook into the message pump (IMessageFilter) and manually forward WM_MOUSEWHEEL events to the parent Form containing the richtextbox. When I am inside of RichTextBox and perform a mouse scroll, the Form does not scroll. Why not? How can I get the Form to scroll?

Keep in mind that scrollbars are set to none for RichTextBox and enabled for the Form. So why isn’t the form getting the scroll event?

public partial class Form4 : Form
{
    public Form4()
    {
        InitializeComponent();
        this.AutoScroll = true;
        richTextBox1.ScrollBars = RichTextBoxScrollBars.None;
    }
}
  • 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-12T05:50:12+00:00Added an answer on June 12, 2026 at 5:50 am

    The form doesn’t scroll because the RichTextBox handles the WM_MOUSEWHEEL itself and doesn’t call DefWindowProc to forward it to its parent. Apparently that doesn’t change when disabling the scroll bars.

    So you either need to implement an IMessageFilter or create a subclass of RichTextEdit that will forward the WM_MOUSEWHEEL as shown here:

    public class NoScrollRichTextBox : RichTextBox
    {
       const int WM_MOUSEWHEEL = 0x020A;
    
       protected override void WndProc(ref Message m)
       {
          // This will completely ignore the mouse wheel, which will disable zooming as well
          if (m.Msg != WM_MOUSEWHEEL)
             base.WndProc(ref m);
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is about WinForms RichTextbox. I have a RichTextbox with ScrollBars property set
I have a RichTextBox on a WPF window that I am using kind of
I have a RichTextBox and a button. Is there any easy way to make
I have a RichTextBox with an OnChanged event. The OnChanged event should look at
Under RichTextBox_TextChanged event, I have if RichTextBox.Lines.Count() > 2 { //Message Box to display
I have a RichTextBox which contains links posted by the users. The problem is
I have a richtextbox in an app and I'd like key words to be
I have a RichTextBox and I need to find the position of the vertical
I have a RichTextBox that I write a string to every time I click
I have a RichTextBox and I add some texts programatically. I need to display

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.