我有一个程序,想用编辑框来显示几万行文字,是一个词库,每行只是一个词。我想让用编辑框显示它,并可以让用户修改,而且用户也可以粘贴自己的词库过来。请问编辑框可以处理几万行,总大小为二、三百K的文字吗?

解决方案 »

  1.   

    CEdit有64k限制,可以用CRichEditCtrl
      

  2.   

    CRichEditCtrl类?请问是MFC的类么?还是在网上下载啊?
      

  3.   


    To send this message, call the SendMessage function as follows. 
    lResult = SendMessage(
    (HWND) hWndControl,
    (UINT) EM_SETLIMITTEXT, 
    (WPARAM) wParam, 
    (LPARAM) lParam      // = 0; not used, must be zero 
    );   wParam
    The maximum number of TCHARs the user can enter. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. This number does not include the terminating null character. 
    Rich edit controls: If this parameter is zero, the text length is set to 64,000 characters. 
    Edit controls on Windows NT/2000/XP: If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or –1 for multiline edit controls. 
    Edit controls on Windows 95/98/Me: If this parameter is zero, the text length is set to 0x7FFE characters for single-line edit controls or 0xFFFF for multiline edit controls. lParam
    This parameter is not used. 
    Return ValueThis message does not return a value. 
      

  4.   


    控件面板上的RichEdit控件
      

  5.   

    Before EM_SETLIMITTEXT is called, the default limit for the amount of text a user can enter in an edit control is 32,767 characters. Edit controls on Windows NT/2000/XP: For single-line edit controls, the text limit is either 0x7FFFFFFE bytes or the value of the wParam parameter, whichever is smaller. For multiline edit controls, this value is either –1 bytes or the value of the wParam parameter, whichever is smaller.
    默认是32767,最大为2G,修改默认使用CEdit::SetLimitText()函数
      

  6.   

    Edit和RichEdit都是编辑框,实现方式不同而已,通常解决字数的限制问题,用RichEdit。