示例#1
0
        /// <summary>
        /// * 함 수 명 : TxtText_KeyPress
        /// * 작 성 자 : 황지희
        /// * 개 요 : key 이벤트 영어(대문자), 숫자만 입력받도록 valid 체크
        /// </summary>
        private void TxtText_KeyPress(object sender, KeyPressEventArgs e)
        {
            TextBox     txt  = (TextBox)sender;
            Control     temp = txt.Parent;
            MaskTextBox mtb  = null;

            while (temp.Parent != null)
            {
                if (temp is MaskTextBox)
                {
                    mtb = temp as MaskTextBox;
                    break;
                }
                temp = temp.Parent;
            }
            if (mtb == null)
            {
                return;
            }

            switch (mtb.Name)
            {
            case "txt_MaskNum":
            case "txt_EqpId":
                CommonFuction.TypingOnlyEngNum(sender, e, mtb);
                break;
            }
        }
示例#2
0
        /// <summary>
        /// * 함 수 명 : MtxtUserID_KeyPress
        /// * 개 요 : mtxtUserID -> 영문대문자, 숫자만 입력가능
        /// </summary>

        private void MtxtUserID_KeyPress(object sender, KeyPressEventArgs e)
        {
            CommonFuction.TypingOnlyEngNum(sender, e, mtxtUserID);

            if (e.KeyChar == (char)Keys.Enter)
            {
                mtxtUserName.Focus();
            }
        }
示例#3
0
        /// <summary>
        /// 텍스트박스 입력 키 제한,엔터키 입력시 TAB키 반환
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void TextBox_KeyPress(object sender, KeyPressEventArgs e)
        {
            TextBox     txt  = (TextBox)sender;
            Control     temp = txt.Parent;
            MaskTextBox mtb  = null;

            while (temp.Parent != null)
            {
                if (temp is MaskTextBox)
                {
                    mtb = temp as MaskTextBox;
                    break;
                }
                temp = temp.Parent;
            }
            if (mtb == null)
            {
                return;
            }

            switch (mtb.Name)
            {
            case "txtVenderID":
                CommonFuction.TypingOnlyEngNum(sender, e, txtVenderID);
                if (e.KeyChar == (char)Keys.Enter)
                {
                    SendKeys.Send("{TAB}");
                }
                break;

            case "txtVenderName":
                if (Char.IsLetter(e.KeyChar) == false && Char.IsDigit(e.KeyChar) == false && e.KeyChar != 8 && e.KeyChar == ',')
                {
                    e.Handled = true;
                }
                if (e.KeyChar == (char)Keys.Enter)
                {
                    SendKeys.Send("{TAB}");
                }
                break;
            }
        }
示例#4
0
 /// <summary>
 ///  2019-05-28 황지희 띄어쓰기 안되도록 변경
 /// </summary>
 private void TxtText_KeyPress(object sender, KeyPressEventArgs e)
 {
     CommonFuction.TypingOnlyEngNum(sender, e, txtNumber);
 }