Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winforms &TimeSpan - Which control works best?

I am building a form with winforms - and should add a view and editable time span value. Which controls works best for this ?

A normal edit control shows the value correctly -> but it's not really nice for changing values

the normal date time picker doesn't work

the masked edit control doesn't have got any standard mask for this

Does anybody have a good idea for a control for this task ?

like image 900
bernhardrusch Avatar asked Dec 01 '22 08:12

bernhardrusch


1 Answers

I built one that had a TextBox coupled with a ComboBox to choose the units. The user control had range settings (value +-) and (time units). Based on the units picked, the text box was ranged checked - e.g., 1-7 days might be valid but if units were minutes, 1-60 minutes might be better.

I've done combinations of two ComboBoxes a NumericUpDown as well.

If you need time spans that are things like 3 days 4 hours 6 minutes, I'd probably opt for a user control with masked text box and range check the parts.

Typically, I opt for the first one, though.

Just my two cents.

like image 121
itsmatt Avatar answered Dec 04 '22 15:12

itsmatt