Announcement

Collapse
No announcement yet.

Does the TEXTBOX (edit control) have a 1024 maximum line length before it wraps?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Does the TEXTBOX (edit control) have a 1024 maximum line length before it wraps?

    It appears that I may have bumped into a TEXTBOX control limitation.

    I used DDT to create a multi-line, read-only TEXTBOX with both vertical and horizontal scroll bars. I load records from the data area of a DBF file for visual comparison. It works great as long as the record length is less than 1025 bytes; if the record is more than 1024 characters long it wraps to the next line.

    So, is 1024 an EDIT control limit? Can I increase it?


    ------------------

  • #2
    Seems to be the limit, yes. Don't know how to increase it, sorry.
    Probably not possible, since it must have something to do with the
    buffers it uses. Maybe a Rich edit control can handle this better?


    ------------------

    Comment


    • #3
      Is this a way to handle the situation?
      Code:
      EditWordBreakProc
      The EditWordBreakProc function is an application-defined callback function used with the 
      EM_SETWORDBREAKPROC message. A multiline edit control or a rich edit control calls an 
      EditWordBreakProc function to break a line of text.
      The EDITWORDBREAKPROC type defines a pointer to this callback function. 
      EditWordBreakProc is a placeholder for the application-defined function name.

      ------------------
      Fred
      mailto:[email protected][email protected]</A>
      http://www.oxenby.se

      Fred
      mailto:[email protected][email protected]</A>
      http://www.oxenby.se

      Comment


      • #4
        Borje,

        Hmmm. I haven't investigated RichEdit, I don't know if it has the same limit. Looks like I'll have to add some code to break the long records into smaller pieces--not what I want, but better than wrapped lines. Thanks for your thoughts.

        Terry


        ------------------

        Comment


        • #5
          Fred,

          A multiline edit control or a rich edit control calls an EditWordBreakProc function to break a line of text.
          I'm not sure if that could be used to NOT break a line, or to increase the 1024 character limit. Thanks for the suggestion.

          Terry


          ------------------

          Comment


          • #6
            Yes, Richedit seems to be the way to go. Following works:
            Code:
            '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            ' Template
            '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            #COMPILE EXE
            #INCLUDE "WIN32API.INC"
            %ID_TEXT     = 20
            %ID_RICHEDIT = 30
             
            '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            ' Create dialog and controls, etc
            '¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
            FUNCTION PBMAIN () AS LONG
              LOCAL hDlg AS LONG, hRichEd AS LONG, txt AS STRING
              txt = REPEAT$(1000, "OK ")              '<- 3000 byte line..
              hRichEd = LoadLibrary("RICHED32.DLL")
             
              DIALOG NEW 0, "Template",,, 200, 130, %WS_SYSMENU, 0 TO hDlg
              CONTROL ADD TEXTBOX, hDlg, %ID_TEXT, txt + $CRLF + "Textbox wraps long lines", _
                                  4, 4, 188, 50, %WS_CHILD OR %ES_MULTILINE OR %ES_READONLY OR _
                                   %WS_HSCROLL OR %ES_AUTOHSCROLL, %WS_EX_CLIENTEDGE
             
              CONTROL ADD "RichEdit", hDlg, %ID_RICHEDIT, txt + $CRLF + "Richedit don't", _
                          4, 60, 188, 50, %WS_CHILD OR %WS_VISIBLE OR %ES_MULTILINE OR _
                          %ES_READONLY OR %WS_HSCROLL OR %ES_AUTOHSCROLL, %WS_EX_CLIENTEDGE
             
              CONTROL SET FOCUS hDlg, %ID_RICHEDIT
              DIALOG SHOW MODAL hDlg
              FreeLibrary hRichEd
            END FUNCTION
            ------------------

            Comment


            • #7
              Borje, that works, thanks!

              ------------------

              Comment


              • #8
                Just for the record: it appears that RichEdit (Windows 98) has a limit of 4095 characters before it wraps the line. For my purposes that's good enough.


                ------------------

                Comment

                Working...
                X