Scrolling Text

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

    #1

    Scrolling Text

    I'm trying to develop a control similar to TextBox and RichTextBox - less
    functional actually but with a wrinkle which I need and which TextBox and
    RichTextBox do not have. I can use a statement like this

    grfx.DrawString ("The quick brown fox jumped over ...", Font, Brushes.Black,
    rectf)

    to display text in a control. This call wraps the text, so the resulting
    display might look like this ...

    The quick
    brown fox
    jumped over
    ....

    But what do I do when I want to scroll down one line? So far as I can tell
    I have no way of knowing where the text wrapped. I know that I could do the
    wrapping myself iteratively using MeasureString to determine where the wrap
    will occur and then keeping track of the offset to the first character of
    each line and how many characters fit on that line. But that seems very
    inelegant and very inefficient - especially since the call to DrawString
    which automatically wraps the text is already figuring that out. So is
    there a solution to this or will I have to bite the bullet and do it the
    inelegant and inefficient way?

    Thanks, Bob


Working...