在Win32编辑控件中插入带有换行符的文本. [英] Inserting text with new lines in Win32 Edit Control.

查看:91
本文介绍了在Win32编辑控件中插入带有换行符的文本.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道如何使用预定义的Microsoft窗口类创建编辑控件.而且我知道我可以使用SetWindowText或WM_SETTEXT将文本插入该编辑控件.但是我不知道如何用新行添加文本.而且ASCII控制字符也不起作用.需要帮忙.

注意:
我正在使用没有MFC的C ++ Win32.
我正在对话框中创建控件.

I know how to create an edit control using predefined microsoft window classes. And I know that I can insert text into that edit control using SetWindowText or using WM_SETTEXT. But I don''t know how to add texts with new lines. And Also ASCII control characters don''t work. Need help.

NOTE:
I''m using C++ Win32 without MFC.
I am creating the control in a dialog box.

推荐答案

前一阵子,但我记得编辑控件必须具有ES_MULTILINE样式,而不是''\ n",您必须使用"\ r \ n"作为换行符.
It was a while ago but I remember that the edit control must have the ES_MULTILINE style and instead of ''\n'' you must use ''\r\n'' for line breaks.


这篇关于在Win32编辑控件中插入带有换行符的文本.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆