RT

解决方案 »

  1.   

    可以用getlinecount得到总行数,有得到当前显示文本的最大列数的吗?
      

  2.   

    CRichEditCtrl::LineLength
    int LineLength( int nLine = -1 ) const;Return ValueWhen LineLength is called for a multiple-line edit control, the return value is the length (in bytes) of the line specified by nLine. When LineLength is called for a single-line edit control, the return value is the length (in bytes) of the text in the edit control.ParametersnLineSpecifies the character index of a character in the line whose length is to be retrieved. If this parameter is –1, the length of the current line (the line that contains the caret) is returned, not including the length of any selected text within the line. When LineLength is called for a single-line edit control, this parameter is ignored.ResCall this function to retrieve the length of a line in a rich edit control. Use the LineIndex member function to retrieve a character index for a given line number within this CRichEditCtrl object.For more information, seeEM_LINELENGTH in the Win32 documentation.ExampleSee the example for LineIndex.CRichEditCtrl Overview |  Class Members |  Hierarchy ChartSee Also   CRichEditCtrl::LineIndex
      

  3.   

    : findcaiyzh(秋心) 
    是啊,正是因为每行显示的字符数可能不同,才想得到其中字符数最多的行的列数,就是这个意思。有没有现成的函数啊?
      

  4.   

    应该不麻烦吧,只是效率可能慢一点。如果有效率的需求,可以采用类似于缓存的技术,先在自己的一个buffer里排序好了,在给richedit显示。
      

  5.   

    I think u shold scan every line,and use the func LineLength,to get the max one