Solved

Disable RichTextBox Left Mouse Click

Posted on 2004-08-31
7
780 Views
Last Modified: 2011-09-20
hi-

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

thanks -p
0
Comment
Question by:pipe
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

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

Accepted Solution

by:
somnatic earned 75 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 ?
 
0
 
LVL 10

Expert Comment

by:123654789987
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
            textbox2.Select()
        End If
    End Sub

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:pipe
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?
thx
0
 
LVL 10

Expert Comment

by:123654789987
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 :-)
0
 
LVL 4

Expert Comment

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

Author Comment

by:pipe
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Please explain "Multi-Tenant Services" 5 60
Remove greater than sign 3 41
Error on Add method 1 37
C#  Radio button search for Date not DateTime 4 32
Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

930 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now