LearnOneTime
LearnOneTime

Reputation:

RichTextBox appearance

I am showing some text on RichTextBox in a winform. But I dont want the user to interact with it. Even after setting it Read Only, I can still see the cursor blinking inside it. If I disable it, the text gets faded which I dont want. Any idea how can I make it work or any work around. I am using RichTextbox because I need multilines and I need to show the borders around it. And its size is fixed.

Upvotes: 3

Views: 520

Answers (2)

Learner
Learner

Reputation: 990

In the Enter event of the textbox, focus another control.

Upvotes: -1

Daniel LeCheminant
Daniel LeCheminant

Reputation: 51131

Set the following properties on your RichTextBox

Enabled  = false
ReadOnly = true
ForeColor = #000001 // From code, say = Color.FromArgb(0, 0, 1)

The "trick" is setting the ForeColor to something that isn't quite black (#000000); if you do that then the text won't come out as gray when the RichTextBox is disabled.

Upvotes: 6

Related Questions