怎么在edit box中显示几行文字?显示完一行后马上换行再显示另一行。要达到这样的效果怎么样做?

解决方案 »

  1.   

    BOOL SetDlgItemText(          HWND hDlg,
        int nIDDlgItem,
        LPCTSTR lpString
    );
    ParametershDlg
    [in] Handle to the dialog box that contains the control. 
    nIDDlgItem
    [in] Specifies the control with a title or text to be set. 
    lpString
    [in] Pointer to the null-terminated string that contains the text to be copied to the control. 
    Return ValueIf the function succeeds, the return value is nonzero.If the function fails, the return value is zero. To get extended error information, call GetLastError. 实现换行的功能,在Edit编辑框的属性中选取Style标签页,选中Want Return选项
      

  2.   

    选择edit box的属性multiline,
    SetDlgItemText(id, string);
      

  3.   

    SetDlgItemText(IDC_EDIT2, "111");
    SetDlgItemText(IDC_EDIT2, "222");
    SetDlgItemText(IDC_EDIT2, "333");
    SetDlgItemText(IDC_EDIT2, "444");我选了Want Return,可是还是只能显示444。要多行显示到底怎么弄吗?
      

  4.   

    也选择了edit box的属性multiline,可是就是不行哟。
      

  5.   

    每次显示的字符串都把以前的覆盖了阿你可以找个CString strEdit每次strEdit = strEdit + "\n4444"然后SetDlgItemText(IDC_EDIT2, strEdit);