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. Lines in CEdit

Lines in CEdit

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 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.
  • S Offline
    S Offline
    SLiDeR
    wrote on last edited by
    #1

    How to determine the count of visible strings in CEdit?

    H 1 Reply Last reply
    0
    • S SLiDeR

      How to determine the count of visible strings in CEdit?

      H Offline
      H Offline
      HPSI
      wrote on last edited by
      #2

      Get the client rect of the CEdit. Use m_edit.GetDC() to get a DC, then call pDC->GetTextExtent("A") to get the height of a line. Finally, divide the client rect height by the height of a line. Note that there might be a partial line. Don't forget to release the DC. HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.

      S 1 Reply Last reply
      0
      • H HPSI

        Get the client rect of the CEdit. Use m_edit.GetDC() to get a DC, then call pDC->GetTextExtent("A") to get the height of a line. Finally, divide the client rect height by the height of a line. Note that there might be a partial line. Don't forget to release the DC. HPS HwndSpy - GUI developer's aid to visually locate and inspect windows. For the month of August only, use coupon code CP-81239 for 30% off.

        S Offline
        S Offline
        SLiDeR
        wrote on last edited by
        #3

        And what with line interval? Does pDC->GetTextExtent("A") consider it?

        D 1 Reply Last reply
        0
        • S SLiDeR

          And what with line interval? Does pDC->GetTextExtent("A") consider it?

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Are you referring to the spacing between the lines?

          S 1 Reply Last reply
          0
          • D David Crow

            Are you referring to the spacing between the lines?

            S Offline
            S Offline
            SLiDeR
            wrote on last edited by
            #5

            Yes.

            L 1 Reply Last reply
            0
            • S SLiDeR

              Yes.

              L Offline
              L Offline
              l a u r e n
              wrote on last edited by
              #6

              gettextextent() takes that into account afaik


              "there is no spoon"
              biz stuff   about me

              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