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. caret position

caret position

Scheduled Pinned Locked Moved C#
questiondatabase
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.
  • A Offline
    A Offline
    Agyeman
    wrote on last edited by
    #1

    Hi guys, This is what I am trying to do. Basically, I have a couple of data and I want to insert them into specific positions in a rich text box. Now i am able to copy the data onto the clipboard. the next step is to be able to move the caret to the specified index position and then be able to paste the data from the clip board. my question is, how do i make the caret to move to the specified index position. thanks Nana

    C S 2 Replies Last reply
    0
    • A Agyeman

      Hi guys, This is what I am trying to do. Basically, I have a couple of data and I want to insert them into specific positions in a rich text box. Now i am able to copy the data onto the clipboard. the next step is to be able to move the caret to the specified index position and then be able to paste the data from the clip board. my question is, how do i make the caret to move to the specified index position. thanks Nana

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      There's a selectedText property, from memory. Whatever it is, you set the selected text to be the position you want, and a length of 0. This places the caret where you want it, without selecting anything. Christian Graus - Microsoft MVP - C++

      1 Reply Last reply
      0
      • A Agyeman

        Hi guys, This is what I am trying to do. Basically, I have a couple of data and I want to insert them into specific positions in a rich text box. Now i am able to copy the data onto the clipboard. the next step is to be able to move the caret to the specified index position and then be able to paste the data from the clip board. my question is, how do i make the caret to move to the specified index position. thanks Nana

        S Offline
        S Offline
        S Senthil Kumar
        wrote on last edited by
        #3

        You are looking for the SelectionStart[^] property. Like Chris said, set SelectionLength to 0 and set SelectionStart to the caret position. Regards Senthil _____________________________ My Blog | My Articles | WinMacro

        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