Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Textbox not scrolling

Textbox not scrolling

Scheduled Pinned Locked Moved Visual Basic
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mark06
    wrote on last edited by
    #1

    I've got a textbox that updates with some information when an event fires. The textbox multiline value is set to true. A message is appended to a new line in the textbox. But if the number of lines exceeds the size of the control, the vertical scroll bar appears, but it stays at the top position. It wont automatically scroll down to the last entry. I've been trying: TextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.SelectionStart = TextBox1.Text.Length or TextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.Select (TextBox1.Text.Length, 0) But no luck. Any ideas?

    L 1 Reply Last reply
    0
    • M Mark06

      I've got a textbox that updates with some information when an event fires. The textbox multiline value is set to true. A message is appended to a new line in the textbox. But if the number of lines exceeds the size of the control, the vertical scroll bar appears, but it stays at the top position. It wont automatically scroll down to the last entry. I've been trying: TextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.SelectionStart = TextBox1.Text.Length or TextBox1.Text = TextBox1.Text & vbCrLf & Message TextBox1.Select (TextBox1.Text.Length, 0) But no luck. Any ideas?

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Hi, when the caret is present, you can make the line containing it visible with TextBoxBase.ScrollToCaret() :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google


      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups