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 in a being edited Node

caret position in a being edited Node

Scheduled Pinned Locked Moved C#
question
4 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.
  • T Offline
    T Offline
    TyronX
    wrote on last edited by
    #1

    How do I set the Position of the caret of a Node in a Treeview that's being edited? There isn't a Select() function available like it is with textboxes

    D 1 Reply Last reply
    0
    • T TyronX

      How do I set the Position of the caret of a Node in a Treeview that's being edited? There isn't a Select() function available like it is with textboxes

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      There is nothing in the .NET BCL that will do this. There is no method to call anywhere in the TreeView or TreeViewNode, it's just not supported. I don't even know if the underlying TreeView control that the TreeView class wraps supports it. You might be able to "fudge it" by getting the handle to the control that holds the text being edited and using the Win32 API SendMessage function call to send it the appropriate messages to position the caret. Don't ask me for details, I can't give them to you. This is all just a theory... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        There is nothing in the .NET BCL that will do this. There is no method to call anywhere in the TreeView or TreeViewNode, it's just not supported. I don't even know if the underlying TreeView control that the TreeView class wraps supports it. You might be able to "fudge it" by getting the handle to the control that holds the text being edited and using the Win32 API SendMessage function call to send it the appropriate messages to position the caret. Don't ask me for details, I can't give them to you. This is all just a theory... RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        T Offline
        T Offline
        TyronX
        wrote on last edited by
        #3

        ok, it isn't that necassary. Thanks anyway.

        T 1 Reply Last reply
        0
        • T TyronX

          ok, it isn't that necassary. Thanks anyway.

          T Offline
          T Offline
          TyronX
          wrote on last edited by
          #4

          Darn. It seems that the Node Text can't be changed even after that text has been edited. At least it doesn't work when I do this in the AfterLabelEdit-Event because the new Node text gets assigned after this even or something like that

          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