我在一个基于对话框的应用程序中,准备使用EDIT控件作为文本的显示框。我起初是想用ReplaceSel()但是他的参数表里只能加字符型的数组,我给数组赋值的时候无法将换行符'\t'或者endl赋给它,是不是换行符不用这两个啊?而且我发现,给数组一个一个赋值,输出的时候总是有错。有没有其他的办法输出文本呢?我在做一个基于对话框的小程序。EDIT控件里要输出数据列表,就像职工列表一样,有没有什么其他的办法呢?由于这个程序很急,如果有那位能够相助,我感激不尽。(麻烦说详细一点)
解决方案 »
- socket使用的一个细节问题?
- 字符转换问题
- 哪位仁兄 能给我 扫下盲啊 关于 H263视频压缩 解压的 最好有代码
- 问个VC6的故障
- 请教:怎样生成rtf格式的文件
- 使用memDC绘图,在窗口放大后的图像有锯齿状怎么解决?
- 各位大虾,在网络当中如何才能得到本地以及其他的计算机的IP地址和计算机名。(最好有源代码)谢谢!!!!!!
- 在VC中如何调用一个不在当前目录下的DLL
- 要成为一名优秀的VC++程序员,需要看哪些书。
- ===== 应聘题一 ======
- 请问怎么互相转换LPCTSTR,CString,char[]的数据类型???在线
- 请C++高手指点一下学习C++的各个阶段以及学习重点和需要看的书。
我也做了一个数组,然后位Edit控件定义一个CString str1的变量,然后再定义一个CString str2的变量。首先做一个循环,每次从数组里面读一个数,并把它转换成字符串类幸赋给str2,然后通过调用CString中的Insert函数,把它插入str1的末尾,在循环中,需要换行的时候,就在插入\r\n就可以了。
最后一起输出!!!
BOOL bAddEOL
);
Parameters
bAddEOL
Specifies whether soft line-break characters are to be inserted. A value of TRUE inserts the characters; a value of FALSE removes them.
Return Value
Nonzero if any formatting occurs; otherwise 0.Res
A soft line break consists of two carriage returns and a linefeed inserted at the end of a line that is broken because of word wrapping. A hard line break consists of one carriage return and a linefeed. Lines that end with a hard line break are not affected by FmtLines. Windows will only respond if the CEdit object is a multiple-line edit control. FmtLines only affects the buffer returned by GetHandle and the text returned by WM_GETTEXT. It has no impact on the display of the text within the edit control.For more information, see EM_FMTLINES in the Platform SDK.Example
#ifdef _DEBUG
// The pointer to my edit.
extern CEdit* pmyEdit;
CString strText; // Add soft line-break breaks.
pmyEdit->FmtLines(TRUE); // Dump the text of the edit control.
pmyEdit->GetWindowText(strText);
afxDump << strText; // Remove soft line-break breaks.
pmyEdit->FmtLines(FALSE);
#endif