想要把edit控件里面从0到n行设置成为select状态, 以便能够使用ReplaceSel来进行置换应怎样做?

解决方案 »

  1.   

    CEdit::SetSel
    This method selects a range of characters in an edit control.void SetSel( 
    DWORD dwSelection, 
    BOOL bNoScroll = FALSE ); void SetSel( 
    int nStartChar, 
    int nEndChar, 
    BOOL bNoScroll = FALSE ); 
    Parameters
    dwSelection 
    Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is zero and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed. 
    bNoScroll 
    Indicates whether the caret should be scrolled into view. If FALSE, the caret is scrolled into view. If TRUE, the caret is not scrolled into view. 
    nStartChar 
    Specifies the starting position. If nStartChar is zero and nEndChar is –1, all the text in the edit control is selected. If nStartChar is –1, any current selection is removed. 
    nEndChar 
    Specifies the ending position. 
    你说的这个0到n行是什么意思。。
      

  2.   

    我的EDIT控件里面已经写了很多行字符,这些字符的0到n行
      

  3.   

    TO:AMITUOFO(阿弥陀佛下面这个帖子有相同得问题,我做了解答,你去看看吧:http://community.csdn.net/Expert/topic/3962/3962379.xml?temp=.4024927