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. Static Text Control Wordwrap

Static Text Control Wordwrap

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 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.
  • D Offline
    D Offline
    daveyerwin
    wrote on last edited by
    #1

    How can I retrieve text from a static text control that has wrapped the text , I want to get the text with the line breaks that the control added , or I would like to know the number of lines the wrapped text is printed on . I would also want to know what text is not displayed because it has "overflowed" off the viewing area . Thanks for reading this . Davey

    M G 2 Replies Last reply
    0
    • D daveyerwin

      How can I retrieve text from a static text control that has wrapped the text , I want to get the text with the line breaks that the control added , or I would like to know the number of lines the wrapped text is printed on . I would also want to know what text is not displayed because it has "overflowed" off the viewing area . Thanks for reading this . Davey

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      I don't see any way to get this info from a static control. The wrapping is probably done at the time the text is rendered. You could parse the text yourself and calculate wrap positions using GetTextExtentExPoint() and render the text youself. Mark

      "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

      R 1 Reply Last reply
      0
      • M Mark Salsbery

        I don't see any way to get this info from a static control. The wrapping is probably done at the time the text is rendered. You could parse the text yourself and calculate wrap positions using GetTextExtentExPoint() and render the text youself. Mark

        "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

        R Offline
        R Offline
        Rick York
        wrote on last edited by
        #3

        There are articles on this site that illustrate this technique.

        1 Reply Last reply
        0
        • D daveyerwin

          How can I retrieve text from a static text control that has wrapped the text , I want to get the text with the line breaks that the control added , or I would like to know the number of lines the wrapped text is printed on . I would also want to know what text is not displayed because it has "overflowed" off the viewing area . Thanks for reading this . Davey

          G Offline
          G Offline
          Gary R Wheeler
          wrote on last edited by
          #4

          The DrawText[^] GDI function might be of some help here.


          Software Zen: delete this;

          Fold With Us![^]

          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