开发者

How to enforce hour format?

开发者 https://www.devze.com 2023-03-23 09:02 出处:网络
I am using a textbox in vb.net but the input should be an hour format for example, \"13h30\". How can I enfprce this by a user? When he puts the first 2 digits like 13 then automatic开发者_如何学运维l

I am using a textbox in vb.net but the input should be an hour format for example, "13h30". How can I enfprce this by a user? When he puts the first 2 digits like 13 then automatic开发者_如何学运维ly the appl. puts a "h" between? Or is there a better solution?

thx


If you are using WinForms then you could use a masked textbox with a mask of 00h00. This doesn't work too well if they subsequently want to edit the value they have entered though as the rightmost digits are shifted left if you do a backspace. You may be better off making a user control

0

精彩评论

暂无评论...
验证码 换一张
取 消