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. Updating text with Spaces in RichEditCtrl

Updating text with Spaces in RichEditCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
2 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.
  • A Offline
    A Offline
    Azghar Hussain
    wrote on last edited by
    #1

    Hi All!!! I Had A strange requirement regarding RichEditCtrl. I need to Limit the TextLength(Max Charecters) in Each Line of Richeditctrl to 50.In addition to that i need to insert spaces after every 10 charecters in each line.so in each Line Altogether 5 spaces will be there. In case if user added,deleted,modified charecters the alignment with spaces should not change..this is my requirement.I tried USing LineLength but notreaching my requirement. Thanks:doh: If you have faith in the cause and the means and in God, the hot Sun will be cool for you.

    C 1 Reply Last reply
    0
    • A Azghar Hussain

      Hi All!!! I Had A strange requirement regarding RichEditCtrl. I need to Limit the TextLength(Max Charecters) in Each Line of Richeditctrl to 50.In addition to that i need to insert spaces after every 10 charecters in each line.so in each Line Altogether 5 spaces will be there. In case if user added,deleted,modified charecters the alignment with spaces should not change..this is my requirement.I tried USing LineLength but notreaching my requirement. Thanks:doh: If you have faith in the cause and the means and in God, the hot Sun will be cool for you.

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      In that case, you need to store all the characters that aren't spaces, and ignore spaces altogether. Then you need when you display your text to insert the spaces where you need them. There's no point having them as part of the underlying string, if they have to always be there, it's actually a display issue, not an issue of the string value. I guess the best way to do that is to derive a class from the RichEditControl. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      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