Disable RichTextBox Left Mouse Click

Posted on 2004-08-31
Medium Priority
Last Modified: 2011-09-20

how can i disable the left mouse click for a richtextbox so a user cannot move the caret?

thanks -p
Question by:pipe
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2

Author Comment

ID: 11943803
i'd like to be able to highlight text but not have the ability to move the caret position.

Accepted Solution

somnatic earned 300 total points
ID: 11949310
how about used "hidecaret" to hide the caret from the user

To Highlight the Text, you should be able to use the Select Method that comes with RichTextBox programmatically ..

would that be an option ? Or does the user has to be able to select text ?
LVL 10

Expert Comment

ID: 11951272
I don't think u can disable the cursor from appearing the textbox.

What u can do is
Deviate the focus to some other textbox or any other control ex.

 Private Sub TextBox1_MouseDown(ByVal sender As System.Object, ByVal e As MouseEventArgs) Handles TextBox1.MouseDown

        If e.Button = MouseButtons.Left Then
        End If
    End Sub

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 11952977
"how about used "hidecaret" to hide the caret from the user"

hiding the caret would work i think. however, i checked msdn and i didnt see any method for doing this with a richtextbox. do you know how i would go about doing this?
LVL 10

Expert Comment

ID: 11960683
I tried the cursor.hide method. But that works well for a button control. But it does not work for a textbox. So I think my previous reply holds good :-)

Expert Comment

ID: 11960692
who asked about the cursor ..
I thought it was all about the caret ..

Author Comment

ID: 12007750
i did a dll import of the hidecaret method. i got it working. i think i call it on mouseenter or over. thx

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month9 days, 4 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question