简体   繁体   English

TextBox更改选择文本

[英]TextBox change on selection text

I have in TextBox with value of time of my audio. 我在TextBox有音频时间值。 It looks like this: "00:00:00.000" it's format hh:mm:ss.fff , where fff = miliseconds. 看起来像这样:“ 00:00:00.000”,其格式为hh:mm:ss.fff ,其中fff =毫秒。

I need to do in my ViewModel that when I click on hours or minutes or seconds I can change only these values which I select, but cannot remove : or . 我需要在ViewModel ,当我单击小时,分钟或秒时,我只能更改我选择的这些值,但不能将它们删除:. . Length of hours, minutes and seconds must be max 2 numbers each one and miliseconds = 3 numbers. 时长,分钟和秒的长度每个最多2个数字,毫秒= 3个数字。

Can someone help me to do this? 有人可以帮我做到这一点吗? Thanks a lot. 非常感谢。

EDITED: I would like make textbox works like "change time" in Windows 7 编辑:我想让文本框像Windows 7中的“更改时间”

您只需要MaskedTextBox,否则您应该使用期望函数创建一个用户控件

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

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