简体   繁体   English

在NumericUpDown控件中设置光标位置

[英]Setting the cursor position in a NumericUpDown Control

I have created a user control tha inherits from the NumericUpDown Control. 我创建了一个从NumericUpDown控件继承的用户控件。 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. 我正在验证文本OnKeyUp,并在满足某些条件时对其进行格式化。 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. 为此,我必须做me.text = Fomatted(Me.Text),它将光标重新设置为位置0,我想将其设置为文本区域的末尾。

Thanks 谢谢

采用

yourNumericUpDown.Select(desiredPosition,0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM