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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:26:53+00:00 2026-05-22T19:26:53+00:00

In my application I am using RichTextBox es with readonly property set to True.

  • 0

In my application I am using RichTextBoxes with readonly property set to True.
But the font size can still be changed using the mouse wheel and default windows keyboard shortcut for fontsize change (Ctrl+shift+ >/<).

How do I disable RichTextBox font size change?

  • 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-05-22T19:26:54+00:00Added an answer on May 22, 2026 at 7:26 pm

    To disable the key combinations of Control+Shift+< or Control+Shift+>, you need to implement the following KeyDown event handler for your RichTextBox control:

     Private Sub RichTextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles RichTextBox1.KeyDown
    
        ' disable the key combination of 
        '     "control + shift + <" 
        '     or
        '     "control + shift + >"
        e.SuppressKeyPress = e.Control AndAlso e.Shift And (e.KeyValue = Keys.Oemcomma OrElse e.KeyValue = Keys.OemPeriod)
    
    End Sub
    

    This code prevents the user from resizing the font in the given RichTextBox with keyboard commands.

    To disable changing the font size by using Ctrl plus the mousewheel, the only way I know how to do this is to make a user control that inherits from RichTextBox.

    Once you have done that the only thing you need to do is override the WndProc procedure so that it effectively disables any messages when the scrollwheel is moving and the Ctrl button is pressed. See the code below for implementing a UserControl derived from the RichTextBox:

    Public Class DerivedRichTextBox
        Inherits RichTextBox
    
        Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    
            ' windows message constant for scrollwheel moving
            Const WM_SCROLLWHEEL As Integer = &H20A
    
            Dim scrollingAndPressingControl As Boolean = m.Msg = WM_SCROLLWHEEL AndAlso Control.ModifierKeys = Keys.Control
    
            'if scolling and pressing control then do nothing (don't let the base class know), 
            'otherwise send the info down to the base class as normal
            If (Not scrollingAndPressingControl) Then
    
                MyBase.WndProc(m)
    
            End If
    
    
        End Sub
    
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a Silverlight application using the RichTextBox as a rich text editor for
In a winforms application, I'm using a RichTextBox and I'm trying to reduce the
I'm using a RichTextBox control in a .NET Windows Form application. I allow users
Been developing an application using PHP's PEAR framework, but ran into an issue where
Am using RichTextBox in a C#/Winforms application. Am showing some text in this control
I am using RichTextBox control for displaying application logs. I am updating control once
I am developing an Application using vc++ and C# ,the application can Import and
I write windows application using C# and .NET2.0. In RichTextBox I would like to
My application using a GeoCoder keeps returning the string to true. here is the
I am developing an application using PHP in Aptana Studio 3, and have set

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.