如何向编辑控件中添加文本

来源:互联网 发布:大数据调研报告 编辑:程序博客网 时间:2024/05/21 17:50

由于没有CEdit:: AppendText函数,用户只好自己做此项工作。调用CEdit:: SetSel移动到编辑控件末尾,然后调用CEdit:: ReplaceSel添加文本。下例是AppendText 的一种实现方法:

void CMyEdit:: AppendText (LPCSTR pText){int nLen=GetWindowTextLength ();SetFocus ();SetSel (nLen, nLen);ReplaceSel (pText);}


0 0
原创粉丝点击