设置在NumericUpDown控件中的光标位置光标、控件、位置、NumericUpDown

2023-09-07 00:06:21 作者:阿姨,我中意你女儿

我已经创建了一个用户控制塔在NumericUpDown控件继承。 是否有可能设置控件中的光标位置? 我验证了文本的onkeyup,并格式化它时,它符合一定的标准。 要做到这一点我必须做me.text = Fomatted(Me.Text),它设置光标回位0,我想将其设置为文本区域的末尾。

I have created a user control tha inherits from the NumericUpDown Control. Is it possible to set the cursor position within the control? I am validating the text OnKeyUp, and formatting it when it meets certain criteria. To do this i have to do me.text = Fomatted(Me.Text), which sets the cursor back to the position 0, i want to set it to the end of the text area.

感谢

推荐答案

使用

yourNumericUpDown.Select(desiredPosition,0)