富文本框控件 [英] Rich Textbox Control

查看:91
本文介绍了富文本框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


m尝试通过使用GetWindowText()从Microsoft Rich Textbox Control 6.0中提取文本.我的代码是-

CString str;
m_richctrl.GetWindowText(str);
MessageBox(str);

通过使用此bt,获取中止消息和空消息框.
如何从Rich Textbox中获取文本并显示它?
我知道这是非常容易的任务,但是我不知道该怎么做.
请帮我..
在advnc中表示感谢............

Hi,
m trying to extract text from Microsoft Rich Textbox Control 6.0 by using GetWindowText(). My code is-

CString str;
m_richctrl.GetWindowText(str);
MessageBox(str);

bt by using this, m getting abort message and empty messagebox.
How do I get text from Rich Textbox & display it?
I know this is very easy task, bt i don''t know hw to do it.
Plz help me..
Thanx in advnc............

推荐答案

在这些论坛上不接受短信通话.
SMS speak is not acceptable on these forums.


使用GetLine(int nIndex,LPTSTR lpszBuffer)函数从Rich Textbox中读取特定行,它将指定的索引行复制到缓冲区中.要读取整行,请使用GetLineCount()函数,该函数将返回总编号.文本框中的行,使用此make循环读取所有行.
Use GetLine(int nIndex,LPTSTR lpszBuffer) function to read specific line from Rich Textbox it will copy specified index line into buffer. To read whole line use GetLineCount() function which will return you the total no. of lines in Rich Textbox, using this make loop to read all lines.


检查您的m_richctrl是否有效窗口.此外,您在对话框中使用控件的位置或类似在MainFrame中查看.
Check your m_richctrl is valid window or not.Also, Where you are using control in dialog box or like a view in MainFrame.


这篇关于富文本框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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