コード例 #1
0
        /// <summary>
        /// OnKeyDown(Process Down Key)
        /// </summary>
        /// <param name="e"></param>
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.Control &&
                (e.KeyCode == Keys.C || e.KeyCode == Keys.V || e.KeyCode == Keys.X))
            {
                base.OnKeyDown(e);
                return;
            }

            try
            {
                MyObjectPicker box1 = ParentObjectPicker;
                if (!box1.ReadOnly)
                {
                    GridControl grid = box1.DropDownControl;

                    switch (e.KeyCode)
                    {
                    case Keys.Down:
                        if (!box1.DroppedDown)
                        {
                            box1.DroppedDown = true;
                        }
                        MyComboBoxTextBoxArea.MoveCurrentRowDown(grid);
                        e.Handled = true;
                        break;

                    case Keys.Up:
                        MyComboBoxTextBoxArea.MoveCurrentRowUp(grid);
                        e.Handled = true;
                        break;

                    case Keys.Enter:
                        if (box1.DroppedDown)
                        {
                            box1.DroppedDown = false;
                        }
                        e.Handled = true;
                        break;

                    case Keys.Escape:
                        if (box1.DroppedDown)
                        {
                            box1.DroppedDown = false;
                        }
                        e.Handled = true;
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionProcess.ProcessWithResume(ex);
            }
        }
コード例 #2
0
        private void OwnTextChanged()
        {
            //this.ParentOptionPicker.m_userClick = false;

            if (!string.IsNullOrEmpty(this.Text))
            {
                string[] ss = this.Text.Split(new char[] { ',' });
                if (ss.Length > 0)
                {
                    for (int i = 0; i < this.ParentOptionPicker.DropDownControl.DataRows.Count; i++)
                    {
                        string s1   = this.ParentOptionPicker.DropDownControl.DataRows[i].Cells[this.ParentOptionPicker.ValueMember].Value.ToString();
                        string s2   = this.ParentOptionPicker.DropDownControl.DataRows[i].Cells[this.ParentOptionPicker.DisplayMember].Value.ToString();
                        bool   have = false;
                        for (int j = 0; j < ss.Length - 1; ++j)
                        {
                            if (ss[j].Trim() == s1 || ss[j].Trim() == s2)
                            {
                                have = true;
                                break;
                            }
                        }
                        this.ParentOptionPicker.DropDownControl.DataRows[i].Cells[this.ParentOptionPicker.DropDownControl.SelectColumnName].Value = have;
                    }

                    MyComboBoxTextBoxArea.OwnTextChanged(this.ParentOptionPicker.DropDownControl, ss[ss.Length - 1].Trim());
                }
            }
            else
            {
                foreach (DataRow row in this.ParentOptionPicker.DropDownControl.DataRows)
                {
                    row.Visible = true;
                }
            }

            ParentOptionPicker.AdjustDropDownControlHeight();

            int rowCount = ParentOptionPicker.GetVisibleRows();

            if (rowCount > 0)
            {
                this.ParentOptionPicker.OpenDropDown();
            }
            else
            {
                this.ParentOptionPicker.CloseDropDown();
            }

            //this.ParentOptionPicker.m_userClick = true;
        }
コード例 #3
0
        private void OwnTextChanged()
        {
            MyComboBoxTextBoxArea.OwnTextChanged(this.ParentObjectPicker.DropDownControl, this.Text);

            ParentObjectPicker.AdjustDropDownControlHeight();

            int rowCount = ParentObjectPicker.GetVisibleRows();

            if (rowCount > 0)
            {
                this.ParentObjectPicker.OpenDropDown();
            }
            else
            {
                this.ParentObjectPicker.CloseDropDown();
            }
        }