Exemple #1
0
        protected override void ProcessAutoSearchChar(KeyPressEventArgs e)
        {
            //base.ProcessAutoSearchChar(e);
            if (Properties.ReadOnly)
            {
                return;
            }
            char charCode = e.KeyChar;

            if (Properties.CharacterCasing != CharacterCasing.Normal)
            {
                charCode = (Properties.CharacterCasing == CharacterCasing.Lower ? Char.ToLower(e.KeyChar) : Char.ToUpper(e.KeyChar));
            }
            if (Char.IsControl(charCode) && charCode != '\b')
            {
                return;
            }
            if (IsMaskBoxAvailable && Properties.Mask.MaskType != MaskType.None)
            {
                return;
            }
            KeyPressHelper helper = (IsMaskBoxAvailable ? new KeyPressHelper(MaskBox.MaskBoxText,
                                                                             SelectionStart, SelectionLength, Properties.MaxLength) :
                                     new KeyPressHelper(AutoSearchText, Properties.MaxLength));

            helper.ProcessChar(e.KeyChar);
            AutoSearchText = helper.Text;
            e.Handled      = true;
            ProcessFindItem(helper, charCode);
        }