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. C#
  4. TextBox

TextBox

Scheduled Pinned Locked Moved C#
tutorialquestion
4 Posts 2 Posters 1 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.
  • A Offline
    A Offline
    Aviv Halperin
    wrote on last edited by
    #1

    Does anyone know how to add text to a TextBox programaticaly without the cursor jumping to the beginning of the text? Thanks. avivhal

    H 1 Reply Last reply
    0
    • A Aviv Halperin

      Does anyone know how to add text to a TextBox programaticaly without the cursor jumping to the beginning of the text? Thanks. avivhal

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      If you take a look at the documentation for the TextBox control you should notice a SelectionStart. Set that to TextBox.Text.Length - 1 to set the insertion point at the end of the text. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

      A 1 Reply Last reply
      0
      • H Heath Stewart

        If you take a look at the documentation for the TextBox control you should notice a SelectionStart. Set that to TextBox.Text.Length - 1 to set the insertion point at the end of the text. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

        A Offline
        A Offline
        Aviv Halperin
        wrote on last edited by
        #3

        I want to insert the text programaticaly. I am developing for a PDA using the .NET compact framwork. Everytiem I add data programaticaly as follows: textBoxTerminal.Text += (string)str; textBoxTerminal.SelectionStart = textBoxTerminal.Text.Length; textBoxTerminal.ScrollToCaret(); the cursor jumps to the beginning of the text and then jumps to the end. How can I avoid this jump to the beginning of the text before I set the caret position? Thanks. avivhal

        H 1 Reply Last reply
        0
        • A Aviv Halperin

          I want to insert the text programaticaly. I am developing for a PDA using the .NET compact framwork. Everytiem I add data programaticaly as follows: textBoxTerminal.Text += (string)str; textBoxTerminal.SelectionStart = textBoxTerminal.Text.Length; textBoxTerminal.ScrollToCaret(); the cursor jumps to the beginning of the text and then jumps to the end. How can I avoid this jump to the beginning of the text before I set the caret position? Thanks. avivhal

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          The fact that you're targeting the .NET CF is something you should've mentioned up-front. We can't help you if you don't give us all the necessary details. The other poster could've avoiding posting about the Append method if he/she knew that you were targeting .NET CF (and either knew off-hand that it wasn't available or bothered to check the documentation before giving faulty information). Look for my answer on the other responses. This posting is provided "AS IS" with no warranties, and confers no rights. Software Design Engineer Developer Division Sustained Engineering Microsoft [My Articles] [My Blog]

          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