Esempio n. 1
0
        /// <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);
        }