Results 1 to 5 of 5

Thread: Multiline textbox - viewing the text as it is added

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2001
    Location
    Poole, UK
    Posts
    5

    Multiline textbox - viewing the text as it is added

    I have a multi-line textbox, to which I add text throughout the running of the application. (I suppose you could call it a log).
    However, I want to be able to see the last entry on it. If this is beyond the end of the visible part, you have to use the scroll-bar.
    Is there an easy way to make it so that you see the last line by default, and have to use the scroll-bar to see the first entry.

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    After you add a line of text, try this.
    VB Code:
    1. Text1.SelStart = Len(Text1.Text)

  3. #3
    Addicted Member
    Join Date
    Mar 2001
    Posts
    157
    To add a new line to the end (bottom) of the textbox, use:

    TextBox = TextBox & vbCrLf & newline

  4. #4
    PowerPoster beachbum's Avatar
    Join Date
    Jul 2001
    Location
    Wollongong, NSW, Australia
    Posts
    2,274
    Hi
    Set ur textbox to multiline = true and vertical scroll bars
    Then in the applicable event do something like this.
    Regards
    Stuart
    VB Code:
    1. Private Sub Text1_GotFocus()
    2.     Text1.SelStart = Len(Text1.Text)
    3. End Sub
    Stuart Laidlaw
    Brightspark Financial Software
    http://www.gstsmartbook.com

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Text1.SelStart = Len(Text1.Text)
    Text1.SelText = "Some new text"

    This will move the scroll bar down to your last entry.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width