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. display text

display text

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

    Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin

    G R 2 Replies Last reply
    0
    • K kevincwong

      Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin

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

      An edit control in a dialog would do nicely. You can enable several styles that help: "multiline", "want return", and "horizontal scroll" and "vertical scroll". You can set these in the resource editor when you create the control. If the text is formatted using spaces (say, into columns), you may want to set the font used in the edit control to a monospaced font (Courier New, for example).


      Software Zen: delete this;

      1 Reply Last reply
      0
      • K kevincwong

        Hi, I created a SDI project with a few dialogs One of the dialogs is to allow user to open up a file, then the program will parse the data. After that, it will display some text data to the user. I did some search on display text but I am sure what's the best approach. Can or should I use a CDialog to display text? The text is going to be a couple hundred lines and some lines are about 90 characters long. So, I probably need to have vertical & horizontal scroll bars. Any suggestions would be appreciated! Thanks, Kevin

        R Offline
        R Offline
        Rajesh R Subramanian
        wrote on last edited by
        #3

        kevincwong wrote:

        Can or should I use a CDialog to display text?

        Why would you use a CDialog to display text? What exactly do you mean by this? To Display text, a nice idea is to use CEditBox, incase you may want to allow the user to transport this data somewhere else i.e. He may copy this and paste somewhere else. Can you elaborate the problem a little more? You have an apple and me too. We exchange those and have one apple each. You have an idea and me too. We exchange those and have two ideas each. - someone

        K 1 Reply Last reply
        0
        • R Rajesh R Subramanian

          kevincwong wrote:

          Can or should I use a CDialog to display text?

          Why would you use a CDialog to display text? What exactly do you mean by this? To Display text, a nice idea is to use CEditBox, incase you may want to allow the user to transport this data somewhere else i.e. He may copy this and paste somewhere else. Can you elaborate the problem a little more? You have an apple and me too. We exchange those and have one apple each. You have an idea and me too. We exchange those and have two ideas each. - someone

          K Offline
          K Offline
          kevincwong
          wrote on last edited by
          #4

          You are correct. After doing more research, I found that the CEditBox can do exactly what I wanted. I am from Unix side. So, please forgive me if my MFC lingos or knowledge are not good enough. Currently, I am working on a MFC project to do something like inventory control. I already done all backend sql search stuff. Now, I need to display the inventory information to the user in text format. For example: Item 1: something something Quantity: 20 Description: some description......... Item 2: someting else Quantity: 202 Description: some other description......... So, as I mentioned before, the CEditBox works perfectly for me. Regards, KEvin

          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