By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,244 Members | 1,972 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,244 IT Pros & Developers. It's quick & easy.

Blanks vs. Nothing in a RichTextBox

P: n/a
I have a RichTextBox in which I'd like blanks to appear different from
nothing. Imagine a file which does not fill up the RTB. You can't tell how
many, if any, blanks might follow the last visible, i.e. non-whitespace,
character. I thought that I could set the BackColor of the RTB to LightGray
and then the blanks would show up as white. But instead the characters show
up on a LightGray background and the blanks, of course, show up as LightGray
spaces.

Is there a solution (which does not require a lot of graphics expertise and
code)?

Thanks, Bob
Apr 4 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Define 'blank'!
"eBob.com" <eB******@totallybogus.comwrote in message
news:eX**************@TK2MSFTNGP06.phx.gbl...
>I have a RichTextBox in which I'd like blanks to appear different from
nothing. Imagine a file which does not fill up the RTB. You can't tell
how many, if any, blanks might follow the last visible, i.e.
non-whitespace, character. I thought that I could set the BackColor of the
RTB to LightGray and then the blanks would show up as white. But instead
the characters show up on a LightGray background and the blanks, of course,
show up as LightGray spaces.

Is there a solution (which does not require a lot of graphics expertise
and code)?

Thanks, Bob
Apr 4 '08 #2

P: n/a
eBob.com wrote:
I have a RichTextBox in which I'd like blanks to appear different from
nothing. Imagine a file which does not fill up the RTB. You can't
tell how many, if any, blanks might follow the last visible, i.e.
non-whitespace, character. I thought that I could set the BackColor
of the RTB to LightGray and then the blanks would show up as white. But
instead the characters show up on a LightGray background and the
blanks, of course, show up as LightGray spaces.

Is there a solution (which does not require a lot of graphics
expertise and code)?
Put some text like "[End]" at the end?

Andrew
Apr 4 '08 #3

P: n/a
On Apr 3, 11:16*pm, "eBob.com" <eBob....@totallybogus.comwrote:
I have a RichTextBox in which I'd like blanks to appear different from
nothing. *Imagine a file which does not fill up the RTB. *You can't tell how
many, if any, blanks might follow the last visible, i.e. non-whitespace,
character. *I thought that I could set the BackColor of the RTB to LightGray
and then the blanks would show up as white. *But instead the characters show
up on a LightGray background and the blanks, of course, show up as LightGray
spaces.

Is there a solution (which does not require a lot of graphics expertise and
code)?

Thanks, *Bob
Umm, why are you doing this?

If you are just wanting to get the user to clean up their extra blank
lines then just do it for them. A simple loop with a negitive step
through the lines property should allow you to trim off any blank
lines (not sure if calling Trim on the text will work or not).

Thanks,

Seth Rowe [MVP]
Apr 4 '08 #4

P: n/a

"Stephany Young" <noone@localhost>
Define 'blank'!
In your own standard way of replying

Not Maori?

Cor
Apr 4 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.