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: datetimepickers

properties

you try force datetimepicker display milliseconds, painful experience. better off using maskedtextbox. can download timepicker.cs sourceforge: https://sourceforge.net/projects/time-picker/

enter image description here

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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -