C# Winforms DateTimePicker Custom Formatted to Tenths of a Second / Default Selection to Seconds -
my application uses datetimepicker custom formatted display hh:mm:ss.
how can format allow tenths of second? second question when tab datetimepicker, hours section selected first default, there anyway change seconds selected first default? noticed if click updown arrows without tabbing control seconds section selected default.
any experts on datetimepicker out there? or have ideas on alternative can use implement these features?
below picture of how formatted properties:
you try force datetimepicker
display milliseconds, painful experience. better off using maskedtextbox
. can download timepicker.cs sourceforge: https://sourceforge.net/projects/time-picker/
here sample code:
[stathread] static void main() { application.enablevisualstyles(); form f = new form(); var dp = new timepicker("hh:mm:ss.f", true) { location = new point(100, 100) }; dp.byvalue[2] = false; f.controls.add(dp); var bt1 = new button { text = "now", location = new point(110, 130) }; bt1.click += delegate { dp.value = datetime.now; }; int k = 0; dp.valuechanged += delegate { bt1.text = "now " + (k++); }; f.controls.add(bt1); application.run(f); }
Comments
Post a Comment