numericUpDown
numericUpDown 这个控件怎样可以设成这样的时间选择方式
00:00 选择增加是01:00 02:00 ...一直到23:00
超过23:00 后显示00:00 递减也是这个道理
------解决方案--------------------它干不了,要么用datetimepicker,设置为显示时间方式,或者自己做个控件
------解决方案-------------------- timePicker = new DateTimePicker();
timePicker.Format = DateTimePickerFormat.Time;
timePicker.ShowUpDown = true;
timePicker.Location = new Point(10, 10);
timePicker.Width = 100;
Controls.Add(timePicker);
------解决方案--------------------
//
// dateTimePicker1
//
this.dateTimePicker1.CustomFormat = "hh:MM";
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.dateTimePicker1.Location = new System.Drawing.Point(12, 66);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.ShowUpDown = true;
this.dateTimePicker1.Size = new System.Drawing.Size(200, 21);
this.dateTimePicker1.TabIndex = 0;
------解决方案--------------------写错了,
this.dateTimePicker1.CustomFormat = "hh:MM" -> "HH:mm";
你只要在设计器中吧日期控件的
CustomFormat 设置成 HH:mm
Format 设置成 Custom
ShowUpDown 设置成 true
------解决方案--------------------你可以用2个numericUpDown组合用