473,395 Members | 1,658 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to make a RichTextBox un-editable?


I need to have a RichTextBox that displays various text (in color), but
the user cannot highlight or edit the text in anyway, With a regular
textbox, I can set .Enabled=False and that does exactly what I want, but
with the RichTextBox, setting .Enabled=False turns the box grey, and I
need it to stay on the BackGround color....labels won't do, as I need
individual words to be different colors.

Any Ideas?

Scott
Nov 20 '05 #1
7 10704
"Scott" <x@y.com> schrieb

I need to have a RichTextBox that displays various text (in color),
but the user cannot highlight or edit the text in anyway, With a
regular textbox, I can set .Enabled=False and that does exactly what
I want, but with the RichTextBox, setting .Enabled=False turns the
box grey, and I need it to stay on the BackGround color....labels
won't do, as I need individual words to be different colors.

Any Ideas?


Does setting .readonly = true help?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
On Fri, 21 Nov 2003 00:37:02 +0100, Armin Zingler <az*******@freenet.de>
wrote:
"Scott" <x@y.com> schrieb

I need to have a RichTextBox that displays various text (in color),
but the user cannot highlight or edit the text in anyway, With a
regular textbox, I can set .Enabled=False and that does exactly what
I want, but with the RichTextBox, setting .Enabled=False turns the
box grey, and I need it to stay on the BackGround color....labels
won't do, as I need individual words to be different colors.

Any Ideas?


Does setting .readonly = true help?


No, I thought it would too. Not sure what that property does, as I sure
can write to it at runtime!
Nov 20 '05 #3

Does setting .readonly = true help?


No, I thought it would too. Not sure what that property does, as I sure
can write to it at runtime!


you can always write to it using code (the idea is that the user can't alter
the text directly) try setting readonly of the rtb to true in the designer
it works here.

eric
Nov 20 '05 #4
On Fri, 21 Nov 2003 09:13:42 +0100, EricJ <ericRéMo**@ThiSomnipack.be>
wrote:
>
> Does setting .readonly = true help?


No, I thought it would too. Not sure what that property does, as I sure
can write to it at runtime!


you can always write to it using code (the idea is that the user can't
alter
the text directly) try setting readonly of the rtb to true in the
designer
it works here.

eric


Yes, it does almost what I'm after, but the user can still select parts of
the text (hightligting it)

Scott
Nov 20 '05 #5
On Fri, 21 Nov 2003 09:13:42 +0100, EricJ <ericRéMo**@ThiSomnipack.be>
wrote:
>
> Does setting .readonly = true help?


No, I thought it would too. Not sure what that property does, as I sure
can write to it at runtime!


you can always write to it using code (the idea is that the user can't
alter
the text directly) try setting readonly of the rtb to true in the
designer
it works here.

eric


Yes, it does almost what I'm after, but the user can still select parts of
the text (hightligting it)

Scott
Nov 20 '05 #6
"Scott Hather" <x@y.com> schrieb
you can always write to it using code (the idea is that the user
can't alter
the text directly) try setting readonly of the rtb to true in
the
designer
it works here.

eric


Yes, it does almost what I'm after, but the user can still select
parts of the text (hightligting it)


Right, but he can not change it. Why take him the possibility to copy the
text to the clipboard? I often switched to readonly textboxes instead of
labels because of this possibility.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #7
"Scott Hather" <x@y.com> schrieb
you can always write to it using code (the idea is that the user
can't alter
the text directly) try setting readonly of the rtb to true in
the
designer
it works here.

eric


Yes, it does almost what I'm after, but the user can still select
parts of the text (hightligting it)


Right, but he can not change it. Why take him the possibility to copy the
text to the clipboard? I often switched to readonly textboxes instead of
labels because of this possibility.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: kangoo | last post by:
Hi, I'm trying to remove the last charater in a richTextBox. I though richTextBox.Text.Remove(richTextBox.Text.length-1, 1); would work, but it does nothing (eg richTextBox.Text += "some new...
1
by: Nathan Carroll | last post by:
In an mdi environment I constructed a child for with a richtextbox control that is used to load .rtf's. This works fine on the intiatial load of the form but when for is closed and reopened later...
2
by: Leon Friesema | last post by:
Hiyall! I have a RichTextBox inside a UserControl which should be able to indent a block off text (or UnIndent for that matter) like the SourceEditor of VS2003 or WinWord does. All controls on...
2
by: chrisben | last post by:
Hi, I am using .NET 1.1. I put a web address to a RichTextBox and set its DetectUrls property as true. After the app starts, it underline the link automatically but I cannot click it. How can I...
10
by: D Steward | last post by:
I can't seem to add a newline (/n) to get a richtextbox control to display text on successive lines. The text that I type is overwritten. How do I remedy this My example richTextBox->Multiline...
1
by: Eric | last post by:
Using the 1.1 framework. We are using a newly created instance of a RichTextBox Class in our server code to manipulate RTF that is stored in the database. To clarify, we are not using or...
12
by: M O J O | last post by:
Hi, If I inside a thread creates a RichTextBox and only use this inside the thread, will there be any thread problems? I need to convert between Text and RTF inside a thread. Thanks!! M...
3
by: AxOn | last post by:
Hi, I have an application with a Save function. I want to be able to have several tabs(each containing a RichTextBox, created at runtime) open in a tabControl and save the text from each...
0
by: Vincent | last post by:
Dear all, I have implemented a class to export the content of RichTextBox to image in WYSISYG mode so that line breaks on the screen are the same as exported. C# Code: public struct...
1
by: bmerlover | last post by:
I'm having trouble reading quotations inside the richTextBox when a file is opened on to it. I've tried a couple different methods, most of them didn't compile. I came across one that does compile...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.