/// <summary> /// 关系 大于 等于 不等于 /// </summary> protected void insertRelationBox() { if (this.alRelations == null) { this.initRelations(); } Neusoft.FrameWork.WinForms.Controls.NeuComboBox combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); combox.Width = 50; //combox.Location = new Point(this.ButtonOK.Left - iBlankWidth -50,iCurrentRow * 21+(iCurrentRow+1)*iRowBlank +10); //combox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); if (this.myDirection == enuDirection.H) { combox.Location = new Point(iBlankWidth * 4 + 50 + this.iConditionWidth + this.iValueWidth, iCurrentRow * 21 + (iCurrentRow + 1) * iRowBlank); } else { combox.Location = new Point(iBlankWidth * 2 + 10 + this.iValueWidth, iRowBlank * 2 + iCurrentRow * 21 + (iCurrentRow + 1) * (iRowBlank * 3)); } //combox.IsShowCustomerList = true; combox.Visible = true; combox.TabIndex = iCurrentRow * 10 + 4; combox.Name = "relation" + iCurrentRow.ToString().PadLeft(2, '0'); combox.AddItems(this.alRelations); combox.SelectedIndex = 0; combox.IsListOnly = true; combox.SelectedIndexChanged += new EventHandler(comboxRelation_SelectedIndexChanged); combox.KeyPress += new KeyPressEventHandler(combox_KeyPress); this.panel1.Controls.Add(combox); }
/// <summary> /// 条件字段, 如 住院号,姓名 /// </summary> protected void insertConditionBox() { foreach (Control c in this.panel1.Controls) { if (c.Name == "condition" + iCurrentRow.ToString().PadLeft(2, '0')) { return; } } Neusoft.FrameWork.WinForms.Controls.NeuComboBox combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); combox.Width = this.iConditionWidth; if (this.myDirection == enuDirection.H) { combox.Location = new Point(iBlankWidth, iCurrentRow * 21 + (iCurrentRow + 1) * iRowBlank); } else { combox.Location = new Point(iBlankWidth, (iCurrentRow) * 21 + (iCurrentRow + 1) * (iRowBlank * 3)); combox.ForeColor = Color.Blue; } //combox.IsShowCustomerList = true; combox.Visible = true; combox.TabIndex = iCurrentRow * 10 + 1; combox.Name = "condition" + iCurrentRow.ToString().PadLeft(2, '0'); combox.AddItems(this.alConditions); combox.SelectedIndexChanged += new EventHandler(combox_SelectedIndexChanged); combox.KeyPress += new KeyPressEventHandler(combox_KeyPress); combox.SelectedIndex = 0; this.panel1.Controls.Add(combox); }
protected void insertOperationBox(string type) { if (this.alOperations == null) { this.initOperations(); } if (this.alOperations == null) { MessageBox.Show("获取操作符失败"); return; } Neusoft.FrameWork.WinForms.Controls.NeuComboBox combox = new Neusoft.FrameWork.WinForms.Controls.NeuComboBox(); combox.Width = 50; if (this.myDirection == enuDirection.H) { combox.Location = new Point(iBlankWidth * 2 + this.iConditionWidth, iCurrentRow * 21 + (iCurrentRow + 1) * iRowBlank); } else { combox.Location = new Point(iBlankWidth * 2 + this.iConditionWidth, (iCurrentRow) * 21 + (iCurrentRow + 1) * (iRowBlank * 3)); combox.ForeColor = Color.Blue; } //combox.IsShowCustomerList = true; combox.Visible = true; combox.TabIndex = iCurrentRow * 10 + 2; combox.Name = "operation" + iCurrentRow.ToString().PadLeft(2, '0'); combox.KeyPress += new KeyPressEventHandler(combox_KeyPress); combox.IsListOnly = true; try { ArrayList al = this.alOperations.Clone() as ArrayList; if (type == "INT") { al.RemoveAt(3);//去掉包含 } else if (type == "BOOL") { al = new ArrayList(); Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject(); obj.ID = "="; obj.Name = "等于"; obj.Memo = "dy"; al.Add(obj); } else if (type == "DATETIME") { al.RemoveAt(3);//去掉包含 } else//字符串 { // al = new ArrayList(); // Neusoft.FrameWork.Models.NeuObject obj = new Neusoft.FrameWork.Models.NeuObject(); // obj.ID = "="; // obj.Name = "等于"; // obj.Memo = "dy"; // al.Add(obj); // // obj = new Neusoft.FrameWork.Models.NeuObject(); // obj.ID = "like"; // obj.Name = "包含"; // obj.Memo = "bh"; // al.Add(obj); // // obj = new Neusoft.FrameWork.Models.NeuObject(); // obj.ID = "<>"; // obj.Name = "不等于"; // obj.Memo = "bdy"; // al.Add(obj); } combox.AddItems(al); } catch (Exception ex) { MessageBox.Show(ex.Message); } //判断下拉列表里的选项 if (combox.Items.Count > 0) { combox.SelectedIndex = 0; } this.panel1.Controls.Add(combox); }