VC6.0环境下,如何将光标定位在文本框中的所有字符之后?

 我来答
chzhcpu
2009-04-01 · TA获得超过227个赞
知道答主
回答量:89
采纳率:0%
帮助的人:64.6万
展开全部
CEdit::SetSel
void SetSel( DWORD dwSelection, BOOL bNoScroll = FALSE );

void SetSel( int nStartChar, int nEndChar, BOOL bNoScroll = FALSE );

Parameters

dwSelection

Specifies the starting position in the low-order word and the ending position in the high-order word. If the low-order word is 0 and the high-order word is –1, all the text in the edit control is selected. If the low-order word is –1, any current selection is removed.

bNoScroll

Indicates whether the caret should be scrolled into view. If FALSE, the caret is scrolled into view. If TRUE, the caret is not scrolled into view.

nStartChar

Specifies the starting position. If nStartChar is 0 and nEndChar is –1, all the text in the edit control is selected. If nStartChar is –1, any current selection is removed.

nEndChar

Specifies the ending position

CString str;
GetDlgItem(IDC_EDIT_TEST)->GetWindowsText(str);
int length=str.Getlength();
GetDlgItem(IDC_EDIT_TEST)->SetSel(length,length);

参考资料: msdn

推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式