Time pick control
-
Hi all. I'm new in Windows Forms. Is there is some control to enter time data. Like a NumericUpDown, but for time in format MM:SS.mmmm. And where I can find such control (if it exists), what assembly? Dot want to waste time implementing the new one. Thanks.
-
Hi all. I'm new in Windows Forms. Is there is some control to enter time data. Like a NumericUpDown, but for time in format MM:SS.mmmm. And where I can find such control (if it exists), what assembly? Dot want to waste time implementing the new one. Thanks.
There's a DateTimePicker[^] control. Set the format property to Time. Or you can use a use a MaskedTextBox[^] control. There is a sample time format mask provided or you can define your own.
Simon
-
There's a DateTimePicker[^] control. Set the format property to Time. Or you can use a use a MaskedTextBox[^] control. There is a sample time format mask provided or you can define your own.
Simon
-
Well, thanks for reply. I can use them. But custm format doesnt support displaying milliseconds. So, I have to use what Windows Forms have...
If you use the masked text box you should be able to define whatever format you want. Try setting the mask to something like "00:00:00.0000" You'll probably have to manually validate things like the seconds don't go above 59 etc. Is that what you are looking for?
progDes wrote:
So, I have to use what Windows Forms have...
You could write a custom control if you really wanted, but from the sounds of it, I think the masked text box will probably do the job. You could write a custom control and inherit from the masked text box and just add the extra time validation logic. That would be quite a good way of doing things.
Simon
-
If you use the masked text box you should be able to define whatever format you want. Try setting the mask to something like "00:00:00.0000" You'll probably have to manually validate things like the seconds don't go above 59 etc. Is that what you are looking for?
progDes wrote:
So, I have to use what Windows Forms have...
You could write a custom control if you really wanted, but from the sounds of it, I think the masked text box will probably do the job. You could write a custom control and inherit from the masked text box and just add the extra time validation logic. That would be quite a good way of doing things.
Simon