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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. auto scroll in text box

auto scroll in text box

Scheduled Pinned Locked Moved C#
3 Posts 3 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.
  • P Offline
    P Offline
    prasadbuddhika
    wrote on last edited by
    #1

    anyone knows about auto scrolling a text box. eg:using a for loop i add values upto 100 to text box,but it only displays upto 10,means even though the scroll is set , i have to scroll down to see the values, what i want is to automatically scroll while values are adding to text box.

    M 1 Reply Last reply
    0
    • P prasadbuddhika

      anyone knows about auto scrolling a text box. eg:using a for loop i add values upto 100 to text box,but it only displays upto 10,means even though the scroll is set , i have to scroll down to see the values, what i want is to automatically scroll while values are adding to text box.

      M Offline
      M Offline
      Maxim Langman
      wrote on last edited by
      #2

      use ListBox and change the SelectedIndex/SelectedValue property every time you add some record

      M 1 Reply Last reply
      0
      • M Maxim Langman

        use ListBox and change the SelectedIndex/SelectedValue property every time you add some record

        M Offline
        M Offline
        mahesh_134_s
        wrote on last edited by
        #3

        Hi, call the following in the event where u want auto scroll... textBox1.SelectionStart = textBox1.TextLength; textBox1.ScrollToCaret(); For example create one textbox n one button in a form and call the above in the button_click event which adds sum text as well as scrolls the textbox.. private void button1_Click(object sender, EventArgs e) { textBox1.Text = textBox1.Text + " Hi this is a test message"; textBox1.SelectionStart = textBox1.TextLength; textBox1.ScrollToCaret(); ////textBox1.Refresh(); } I think u got the answer for ur question... Regards Mahesh

        modified on Tuesday, March 3, 2009 2:23 AM

        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