如何在编辑控件中插入文本而不丢失先前插入的文本 [英] How to insert text in an edit control without loss previous text inserted

查看:72
本文介绍了如何在编辑控件中插入文本而不丢失先前插入的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我在VS2008中的Win32 API C ++中具有一个编辑控件,我想添加文本而不会丢失之前插入的文本.请帮助我快速

Hello , I have a edit control in Win32 API C++ in VS2008 and I want to add text without the previous text inserted losses.Please help me someone quickly

推荐答案

尝试以下操作:
Try the following:
// get the initial text length
int nLength = edit.GetWindowTextLength();

// put the selection at the end of text
edit.SetSel(nLength, nLength);

// replace the selection
edit.ReplaceSel(pszText);


这篇关于如何在编辑控件中插入文本而不丢失先前插入的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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