protected int SetConfCtlTypeDateRange(int lo, int vo, int wo, int itemY, DataRow r) { //ラベル SetLabel(lo, itemY, _labelSize, BorderStyle.FixedSingle, r[CommonConsts.db_name].ToString() + "Label", r[CommonConsts.col_name].ToString()); DateInitConfControl.MultiLangUtil = _mlu; //自 C1DropDownControl ddc1 = new C1DropDownControl(); this.MainPanel.Controls.Add(ddc1); ddc1.DropDownStyle = DropDownStyle.DropDownList; ddc1.DropDownFormClassName = "FxCommonLib.Controls.DateInitConfControl"; ddc1.Location = new Point(vo, itemY); ddc1.Name = r[CommonConsts.db_name].ToString() + "_1"; ddc1.Size = _moreWideCtlSize; ddc1.ShowFocusRectangle = true; ddc1.TextDetached = true; ddc1.VisibleButtons = DropDownControlButtonFlags.DropDown; ddc1.ImeMode = ImeMode.Disable; SetLabel(wo + 60, itemY, _waveSize, BorderStyle.None, r[CommonConsts.db_name].ToString() + "RLabel", "~"); itemY += RowHeight; //至 C1DropDownControl ddc2 = new C1DropDownControl(); this.MainPanel.Controls.Add(ddc2); ddc2.DropDownStyle = DropDownStyle.DropDownList; ddc2.DropDownFormClassName = "FxCommonLib.Controls.DateInitConfControl"; ddc2.Location = new Point(vo, itemY); ddc2.Name = r[CommonConsts.db_name].ToString() + "_2"; ddc2.Size = _moreWideCtlSize; ddc2.ShowFocusRectangle = true; ddc2.TextDetached = true; ddc2.VisibleButtons = DropDownControlButtonFlags.DropDown; ddc2.ImeMode = ImeMode.Disable; //値設定 string val1 = r[CommonConsts.value1].ToString(); string val2 = r[CommonConsts.value2].ToString(); ddc1.Value = val1; ddc1.Text = DateInitConfControl.GetDisplayValue(val1); ddc2.Value = val2; ddc2.Text = DateInitConfControl.GetDisplayValue(val2); return(itemY); }
void SetVisibleButtons(C1DropDownControl dropDownControl) { var buttons = DropDownControlButtonFlags.None; if (chkUpDown.Checked) { buttons = buttons | DropDownControlButtonFlags.UpDown; } if (chkCombo.Checked) { buttons = buttons | DropDownControlButtonFlags.DropDown; } if (chkModal.Checked) { buttons = buttons | DropDownControlButtonFlags.Modal; } if (chkCustom.Checked) { buttons = buttons | DropDownControlButtonFlags.Custom; } dropDownControl.VisibleButtons = buttons; }
/// <summary> /// 初期値を設定している場合、表示フラグをONにしているか検証する。 /// </summary> /// <returns></returns> public bool ValidateVisibleFlg() { foreach (DataRow dr in _initCondition.Tables[CommonConsts.SearchItemTbl].Rows) { CheckBox visible = (CheckBox)this.MainPanel.Controls[dr[CommonConsts.db_name].ToString() + "Visible"]; if (!visible.Checked) { if (dr[CommonConsts.ctl_type].ToString() == CommonConsts.CtlTypePulldownlist || dr[CommonConsts.ctl_type].ToString() == MESConsts.CtlTypeGroupList || dr[CommonConsts.ctl_type].ToString() == MESConsts.CtlTypeItemGroupList) { C1ComboBox ccb = (C1ComboBox)this.MainPanel.Controls[dr[CommonConsts.db_name].ToString()]; if (ccb.SelectedItem != null) { if (ccb.SelectedItem.ToString() != "") { visible.Select(); MessageBox.Show( _mlu.GetMsg(CommonConsts.MSG_VISIBLE_FLG_ERROR) + "(" + dr[CommonConsts.col_name] + ")", _mlu.GetMsg(CommonConsts.TITLE_ERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } } else if (dr[CommonConsts.ctl_type].ToString() == CommonConsts.CtlTypeDateRange && ConfigMode) { C1DropDownControl c1 = (C1DropDownControl)this.MainPanel.Controls[dr[CommonConsts.db_name].ToString() + "_1"]; C1DropDownControl c2 = (C1DropDownControl)this.MainPanel.Controls[dr[CommonConsts.db_name].ToString() + "_2"]; if (c1.Value.ToString() != "" || c2.Value.ToString() != "") { visible.Select(); MessageBox.Show( _mlu.GetMsg(CommonConsts.MSG_VISIBLE_FLG_ERROR) + "(" + dr[CommonConsts.col_name] + ")", _mlu.GetMsg(CommonConsts.TITLE_ERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else { Control c1 = null; Control c2 = null; c1 = this.MainPanel.Controls[dr[CommonConsts.db_name].ToString()]; if (c1 != null) { if (c1.Text != "") { visible.Select(); MessageBox.Show( _mlu.GetMsg(CommonConsts.MSG_VISIBLE_FLG_ERROR) + "(" + dr[CommonConsts.col_name] + ")", _mlu.GetMsg(CommonConsts.TITLE_ERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } else { c1 = this.MainPanel.Controls[dr[CommonConsts.db_name].ToString() + "_1"]; c2 = this.MainPanel.Controls[dr[CommonConsts.db_name].ToString() + "_2"]; if (c1.Text != "" || c2.Text != "") { visible.Select(); MessageBox.Show( _mlu.GetMsg(CommonConsts.MSG_VISIBLE_FLG_ERROR) + "(" + dr[CommonConsts.col_name] + ")", _mlu.GetMsg(CommonConsts.TITLE_ERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } } } } return(true); }