/// <summary> /// マウスクリックイベントオーバーライド /// </summary> protected override bool InputValue() { bool res = false; if (!readOnly) { CustomDialog.KeyboardDialog kdlg = new CustomDialog.KeyboardDialog(); kdlg.DispMode = KeyboardDialog.KB_MODE.TIME; string msgfmt = CommonProc.MessageText(nosec ? "G009" : "G008"); msgfmt = msgfmt.Replace("%param", paramName); kdlg.Message_Text = msgfmt; if (allowNone && Text == "") { kdlg.InputArea = ""; } else { kdlg.InputArea = internalTimeSpan.ToString(nosec ? "HHmm" : "HHmmss"); } kdlg.AllowNone = allowNone; if (kdlg.ShowDialog() == DialogResult.OK) { if (allowNone && kdlg.InputArea == "") { Text = ""; valueIsNone = true; internalTimeSpan = TimeSpan.MinValue; } else { Text = CommonProc.DatetimeString(kdlg.InputArea); internalTimeSpan = TimeSpan.Parse(Text); valueIsNone = false; } res = true; } kdlg.Dispose(); } return(res); }
/// <summary> /// マウスクリックイベントオーバーライド /// </summary> protected override bool InputValue() { bool res = false; if (!readOnly) { CustomDialog.KeyboardDialog kdlg = new CustomDialog.KeyboardDialog(); kdlg.DispMode = dateOnly ? KeyboardDialog.KB_MODE.DATEONLY : KeyboardDialog.KB_MODE.DATE; kdlg.TimeResolution = nosec ? 1 : 0; kdlg.TimeMin = RangeMin; kdlg.TimeMax = RangeMax; string msgfmt = CommonProc.MessageText(dateOnly ? "G006" : (nosec ? "G011" : "G002")); msgfmt = msgfmt.Replace("%param", paramName); kdlg.Message_Text = msgfmt; if (allowNone && Text == "") { kdlg.InputArea = ""; } else { kdlg.InputArea = internalDateTime.ToString(dateOnly ? "yyyyMMdd" : (nosec ? "yyyyMMddHHmm" : "yyyyMMddHHmmss")); } kdlg.AllowNone = allowNone; if (kdlg.ShowDialog() == DialogResult.OK) { if (allowNone && kdlg.InputArea == "") { Text = ""; valueIsNone = true; internalDateTime = DateTime.MinValue; } else { Text = dateOnly ? CommonProc.DateString(kdlg.InputArea) : CommonProc.DatetimeString(kdlg.InputArea); internalDateTime = DateTime.Parse(Text); valueIsNone = false; } res = true; } kdlg.Dispose(); } return(res); }