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. Edit box

Edit box

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

    I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

    T C E M D 5 Replies Last reply
    0
    • N Nishad S

      I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      EditBox (CEdit in MFC), created with the multiline flag... see the properties box in design mode into Visual Studio


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      N 1 Reply Last reply
      0
      • T toxcct

        EditBox (CEdit in MFC), created with the multiline flag... see the properties box in design mode into Visual Studio


        TOXCCT >>> GEII power
        [toxcct][VisualCalc]

        N Offline
        N Offline
        Nishad S
        wrote on last edited by
        #3

        Is there any method to get the line height in EditBox?

        T 1 Reply Last reply
        0
        • N Nishad S

          Is there any method to get the line height in EditBox?

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          line height ?:confused: you want to count 3 lines or what ?


          TOXCCT >>> GEII power
          [toxcct][VisualCalc]

          N 1 Reply Last reply
          0
          • N Nishad S

            I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

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

            This sounds like an owner drawn control to me, unless the richedit box has a property to centre the text. Christian Graus - Microsoft MVP - C++

            1 Reply Last reply
            0
            • T toxcct

              line height ?:confused: you want to count 3 lines or what ?


              TOXCCT >>> GEII power
              [toxcct][VisualCalc]

              N Offline
              N Offline
              Nishad S
              wrote on last edited by
              #6

              I have an idea to dynamically set the window pos to center. If I have the line height then can calculate the window pos. And also set the visible line count to 3.

              D 1 Reply Last reply
              0
              • N Nishad S

                I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

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

                i guess u want m_Text.LineLength() ??:~ V

                1 Reply Last reply
                0
                • N Nishad S

                  I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

                  M Offline
                  M Offline
                  MailtoGops
                  wrote on last edited by
                  #8

                  You can use MFC CEdit::GetLineCount() or the Win32 Message EM_GETLINECOUNT to get the number of lines. --> . If the number of lines is three or less it should come the center of the dialog vertically. I can't understand your question properly. do you meant to say if the number of lines are 3 or less, you don't want any scrollbar? " Action without vision is only passing time, Vision without action is merely day dreaming, But vision with action can change the world " - Words from Nelson Mandela Thanks & Regards, Gopalakrishnan

                  1 Reply Last reply
                  0
                  • N Nishad S

                    I want to show multiline text in my dialog. I have some conditions. . If the number of lines is three or less it should come the center of the dialog vertically. . If it exceeds 3 lines, 3 lines should appear to the user and a vertical scrollbar should come to view the remaining lines by scrolling down. Which control should I use for the best result? The text will be unicode format. Thanks for suggestions. - NS -

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

                    It sounds like you need to use the ES_CENTER and ES_MULTILINE styles.


                    "One must learn from the bite of the fire to leave it alone." - Native American Proverb

                    1 Reply Last reply
                    0
                    • N Nishad S

                      I have an idea to dynamically set the window pos to center. If I have the line height then can calculate the window pos. And also set the visible line count to 3.

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

                      Nishad S wrote: I have an idea to dynamically set the window pos to center. If you are wanting to center the actual edit control within its parent, you'll need to use MoveWindow() or SetWindowPos(). If you are using MFC, check out the CWnd::CenterWindow() method.


                      "One must learn from the bite of the fire to leave it alone." - Native American Proverb

                      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