disable key event when the focus is on autocompletion box of textbox

后端 未结 4 1126
渐次进展
渐次进展 2021-01-07 04:50

In my project there is a Form mainForm in which there are two textBoxes txtUserName and txtPassword and also a button btnLogin

4条回答
  •  广开言路
    2021-01-07 05:25

    You need to override the keydown event handler.

        protected override void OnKeyDown(KeyEventArgs e)
        {
            //call original event handler. Remove it if you don't need it at all.
            base.OnKeyDown(e);
    
            //Insert your code here....
        }
    

提交回复
热议问题