有关编辑控件的问题 [英] A question about the edit control

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

问题描述

我想实现一个函数,当Edit控件获得焦点后,将光标自动设置为字符串的起始位置.

我需要帮助,谢谢!

I want to Real a Function that When the Edit control get the focus then auto set the cursor to the starting location of the string.

I need help,Thank you !

推荐答案

在大多数情况下(请参阅我对问题的评论;您未指定使用的内容;因此答案可能有所不同),您需要将SelectionStartSelectionLength设置为零;使用WPF时,将CaretIndex设置为零;处理您的编辑控件的焦点事件.

—SA
In most cases (please see my comment to the question; you did not specify what are you using; so the answers may vary), you need to set SelectionStart and SelectionLength to zero; with WPF, set CaretIndex to zero; handle the focusing event of your edit control.

—SA


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

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