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. Setting Rich edit control's width dynamically to fit entire text

Setting Rich edit control's width dynamically to fit entire text

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 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.
  • M Offline
    M Offline
    Muhammad Azam
    wrote on last edited by
    #1

    Hi I want to change WIDTH of my rich edit control as user types text in it, so that it displays the entire text instead of scrolling text horizontally. My rich edit is a multiline control I have used EN_REQUESTRESIZE notification msg but this works only for adjusting height of control and EN_REQUESTRESIZE is working perfectly in case of height, i.e I use to change the control height when i get this msg to show all lines of text. kindly help!!!! its urgent Muhammad Azam

    V 1 Reply Last reply
    0
    • M Muhammad Azam

      Hi I want to change WIDTH of my rich edit control as user types text in it, so that it displays the entire text instead of scrolling text horizontally. My rich edit is a multiline control I have used EN_REQUESTRESIZE notification msg but this works only for adjusting height of control and EN_REQUESTRESIZE is working perfectly in case of height, i.e I use to change the control height when i get this msg to show all lines of text. kindly help!!!! its urgent Muhammad Azam

      V Offline
      V Offline
      Viorel
      wrote on last edited by
      #2

      If your problem is the scroll-bars that unexpectedly appear even after you resized the rich edit control during ENM_REQUESTRESIZE, then please note that the new control size probably should include the width of the control’s borders. Try to specify a little bigger size. Otherwise, what exactly occurs when you type a long line of text?

      M 1 Reply Last reply
      0
      • V Viorel

        If your problem is the scroll-bars that unexpectedly appear even after you resized the rich edit control during ENM_REQUESTRESIZE, then please note that the new control size probably should include the width of the control’s borders. Try to specify a little bigger size. Otherwise, what exactly occurs when you type a long line of text?

        M Offline
        M Offline
        Muhammad Azam
        wrote on last edited by
        #3

        Thanks Viorel, No the problem is not with scroll-bars the problem is that when user types some text in the control and the text reaches right border of control than how much should i increase width of my edit control (based on current font size, face name etc..) so that the next character typed, is visible and no scroll bar or word-wrapping should occur. And when the control's width reaches right border of dialog than word wrapping should occur. thanks Muhammad Azam

        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