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 / C++ / MFC
  4. set caret position to the end in Edit Box

set caret position to the end in Edit Box

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
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.
  • B Offline
    B Offline
    big_denny_200
    wrote on last edited by
    #1

    Hi all again :) I have edit box, where I display long texts(file paths). Problem is that I want the user to be able to see the last part of the text displayed in the Edit Box(it is a file name). How can I do this ? thank you.

    T R 2 Replies Last reply
    0
    • B big_denny_200

      Hi all again :) I have edit box, where I display long texts(file paths). Problem is that I want the user to be able to see the last part of the text displayed in the Edit Box(it is a file name). How can I do this ? thank you.

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      1. CString str = edit.GetWindowText() 2. SetSel(str.GetLength(), str.GetLength())


      TOXCCT >>> GEII power

      [VisualCalc 3.0  updated ][Flags Beginner's Guide  new! ]

      1 Reply Last reply
      0
      • B big_denny_200

        Hi all again :) I have edit box, where I display long texts(file paths). Problem is that I want the user to be able to see the last part of the text displayed in the Edit Box(it is a file name). How can I do this ? thank you.

        R Offline
        R Offline
        RChin
        wrote on last edited by
        #3

        Have a look at the PathCompactPath() and PathCompactPathEx() API functions. They can convert a long path string like: C:\path1\path2\sample.txt to C:\pat...\sample.txt so that it fits within your display window.


        I Dream of Absolute Zero

        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