现在有一个已有的默认单行CEDIT控件,我想把它变成多行的然后我在OnInitDialog函数里加上了 CEdit* pEdit;
BOOL bRet; pEdit = ( CEdit*)GetDlgItem( IDC_EDIT );
bRet = pEdit->ModifyStyle( 0,ES_PASSWORD);但没有什么反应呀,而且bRet返回的值是1,请教一下为什么会出现这个问题

解决方案 »

  1.   

    晕,那刚才copy错了,应该是
    bRet  =  pEdit->ModifyStyle(  0,ES_MULTILINE);
      

  2.   

    点掉AUTO_HSCROLL选项ES_MULTILINE   Designates a multiple-line edit control. (The default is single line.) If the ES_AUTOVSCROLL style is specified, the edit control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If ES_AUTOVSCROLL is not given, the edit control shows as many lines as possible and beeps if ENTER is pressed when no more lines can be displayed. If the ES_AUTOHSCROLL style is specified, the multiple-line edit control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press ENTER. If ES_AUTOHSCROLL is not given, the control automatically wraps words to the beginning of the next line when necessary; a new line is also started if ENTER is pressed. The position of the wordwrap is determined by the window size. If the window size changes, the wordwrap position changes and the text is redisplayed. Multiple-line edit controls can have scroll bars. An edit control with scroll bars processes its own scroll-bar messages. Edit controls without scroll bars scroll as described above and process any scroll messages sent by the parent window.
      

  3.   

    qeq2008挺对的呀,你有在代码中控制的需求么?