Blanks vs. Nothing in a RichTextBox

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • eBob.com

    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


  • Stephany Young

    #2
    Re: Blanks vs. Nothing in a RichTextBox

    Define 'blank'!


    "eBob.com" <eBob.com@total lybogus.comwrot e in message
    news:eXqGEJglIH A.4684@TK2MSFTN GP06.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
    >

    Comment

    • Andrew Morton

      #3
      Re: Blanks vs. Nothing in a RichTextBox

      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


      Comment

      • rowe_newsgroups

        #4
        Re: Blanks vs. Nothing in a RichTextBox

        On Apr 3, 11:16 pm, "eBob.com" <eBob....@total lybogus.comwrot e:
        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]

        Comment

        • Cor Ligthert[MVP]

          #5
          Re: Blanks vs. Nothing in a RichTextBox


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

          Not Maori?

          Cor


          Comment

          Working...