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. I got lines written over by other text in a CEdit control

I got lines written over by other text in a CEdit control

Scheduled Pinned Locked Moved C / C++ / MFC
help
9 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.
  • E Offline
    E Offline
    ElizabethC
    wrote on last edited by
    #1

    I have a CEdit control mapped to a large size text field. When the Read Only box was unchecked, all lines were showing up fine when I scrolled up and down the control. But I have to set the box to Read Only. Once Read Only was checked, when I scrolled up and down using the scrollbar, all text in the edit box was over written by other text. I looked into help but unfortunately was not able to find any information on this problem. Eilzabeth

    J 1 Reply Last reply
    0
    • E ElizabethC

      I have a CEdit control mapped to a large size text field. When the Read Only box was unchecked, all lines were showing up fine when I scrolled up and down the control. But I have to set the box to Read Only. Once Read Only was checked, when I scrolled up and down using the scrollbar, all text in the edit box was over written by other text. I looked into help but unfortunately was not able to find any information on this problem. Eilzabeth

      J Offline
      J Offline
      JWood
      wrote on last edited by
      #2

      Sound like an error in Comctl32.dll. Try to get the latest version from MS. (I don't have a link - it can be done with MS's download utility)

      A E 3 Replies Last reply
      0
      • J JWood

        Sound like an error in Comctl32.dll. Try to get the latest version from MS. (I don't have a link - it can be done with MS's download utility)

        A Offline
        A Offline
        ASchunk
        wrote on last edited by
        #3

        Hi, the same phenomenon occurs from time to time in Word. Don't know what causes this problem. Are you using the TRANSPARENT property anywhere in your code??? Regards. Alex

        E 1 Reply Last reply
        0
        • A ASchunk

          Hi, the same phenomenon occurs from time to time in Word. Don't know what causes this problem. Are you using the TRANSPARENT property anywhere in your code??? Regards. Alex

          E Offline
          E Offline
          ElizabethC
          wrote on last edited by
          #4

          Yes, I have to use TRANSPARENT property to set static labels background while setting background color to the form. Eilzabeth

          1 Reply Last reply
          0
          • J JWood

            Sound like an error in Comctl32.dll. Try to get the latest version from MS. (I don't have a link - it can be done with MS's download utility)

            E Offline
            E Offline
            ElizabethC
            wrote on last edited by
            #5

            The only download I saw was for Window95, too old. Can you send me the link? Eilzabeth

            J 1 Reply Last reply
            0
            • E ElizabethC

              The only download I saw was for Window95, too old. Can you send me the link? Eilzabeth

              J Offline
              J Offline
              JWood
              wrote on last edited by
              #6

              Use the download utility - the one with the the little hard drives on it. J. ---------------------------- I got this "baby on board" sign - Now people will stop intentionally ramming our car.

              E 1 Reply Last reply
              0
              • J JWood

                Use the download utility - the one with the the little hard drives on it. J. ---------------------------- I got this "baby on board" sign - Now people will stop intentionally ramming our car.

                E Offline
                E Offline
                ElizabethC
                wrote on last edited by
                #7

                Can not find it. A url would be greatly appreciated. Eilzabeth

                J 1 Reply Last reply
                0
                • E ElizabethC

                  Can not find it. A url would be greatly appreciated. Eilzabeth

                  J Offline
                  J Offline
                  JWood
                  wrote on last edited by
                  #8

                  I don't have a URL - Even if I had a URL, MS shuffles thing around so much, by the time I gave it to you it would be out of date. J. ----------------------------

                  1 Reply Last reply
                  0
                  • J JWood

                    Sound like an error in Comctl32.dll. Try to get the latest version from MS. (I don't have a link - it can be done with MS's download utility)

                    A Offline
                    A Offline
                    ASchunk
                    wrote on last edited by
                    #9

                    Hi, you told me that you are using the TRANSPARENT mode for displaying your data. The TRANSPARENT mode usually hides a given rectangle around a text in a window. This rectangle would usually require a certain space to be displayed - visible or not - on the screen. So if you don't leave enough space for your characters - that is the height of a character in a certain font and the space for the rectangle - you may overlap the rectangle of one line with another. Note: the rectangle i am speaking of is an abstract rectangle which cannot be physically displayed. You can calculate the necessary number of space for a specific character by using the following code: TEXTMETRIC tm; int cxChar, cyChar; // width and height of a character cxChar = tm.tmAveCharWidth //the average width of a char cyChar = tm.tmHeight + tm.tmExtarnalLeading The TEXTMETRIC structure encapsualtes almost all avaiable information of chars. What your code suffers is a lack of external leading that is the space around a character that is needed to display is. For more information on this structure I refer you to the MFC documentation or Charles Petzold's Programming Windows 5th edition. This may look a bit comlicated but in the end its somewhat straightforward:suss: Hope it works Regards. Alex

                    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