473,473 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Blanks vs. Nothing in a RichTextBox

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
4 1496
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
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
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

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

Not Maori?

Cor
Apr 4 '08 #5

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

Similar topics

6
by: jalkadir | last post by:
I am trying to find a way to remove the leading and tailing blanks from a string. What I have come up with is not doing the work as I expected; because if the value I pass to the function is "...
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...
2
by: JonnyT | last post by:
I searched high and low for an answer on how to auto scroll a richtextbox and now I finally have it. Since it took me a while to get a good efficient way of doing it that didn't require focus to...
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...
9
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how...
34
by: Registered User | last post by:
Hi experts, I'm trying to write a program that replaces two or more consecutive blanks in a string by a single blank. Here's what I did: #include <stdio.h> #include <string.h> #define MAX 80
3
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to...
0
by: Vimalathithan | last post by:
I just developing a editor. I have provide the options like Bold, Italic, underlin, font change, font size change. These font options are keep in with one toolstripbutton. the toolstripbar keep...
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: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.