C
ChrisUttenreither
Hello folks. I'm writing a Roguelike game in C#. It contains a
RichTextBox which displays a map. The map is made up of multicolored
ASCII art. Since this control is displaying a map I do not want a
blinking cursor on it, so I set the Enabled property to false.
Unfortunately this forces the control's background color to be gray.
You can't see the map very well due to this.
I have already tried making a new control called MapDisplayTextBox
which inherets from RichTextBox. I overrode the OnBackColorChanged
event to force the background to be black. A MessageBox is displayed
in the event handler to verify that this took place. It reports the
color is black. However the background of the control is gray. When
you examine the BackColor property directly it returns Color.Black. It
leads me to believe that this behavior is determined somewhere outside
of the class.
There are two possible solutions that I see to my problem.
- Find a way to have a nonEnabled RichTextBox with a background color
of my choosing.
- Find a way to eliminate the blinking carat from an Enabled
RichTextBox.
Thank you very much for your help.
RichTextBox which displays a map. The map is made up of multicolored
ASCII art. Since this control is displaying a map I do not want a
blinking cursor on it, so I set the Enabled property to false.
Unfortunately this forces the control's background color to be gray.
You can't see the map very well due to this.
I have already tried making a new control called MapDisplayTextBox
which inherets from RichTextBox. I overrode the OnBackColorChanged
event to force the background to be black. A MessageBox is displayed
in the event handler to verify that this took place. It reports the
color is black. However the background of the control is gray. When
you examine the BackColor property directly it returns Color.Black. It
leads me to believe that this behavior is determined somewhere outside
of the class.
There are two possible solutions that I see to my problem.
- Find a way to have a nonEnabled RichTextBox with a background color
of my choosing.
- Find a way to eliminate the blinking carat from an Enabled
RichTextBox.
Thank you very much for your help.