验证文本框上输入的textBox值 [英] validate textBox value on text enter

查看:57
本文介绍了验证文本框上输入的textBox值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在不使用sql server的窗口应用程序中单击按钮的情况下在文本框中输入匹配的文本值时填充数据集.请帮助我

i want to fill dataset on entering matching text value in text box without clicking the button in window application using sql server how it it possible.Please help me

推荐答案

三个选项:
- Control.TextChanged [ - Control.Leave [
Three options:
- Control.TextChanged[^]. Note that it is fired whenever the text changes, i.e. if you type ''Hello'' you get 5 events. Useful for dynamic filtering of an autocomplete list or similar.
- Control.Leave[^], as mentioned by Nit. (LostFocus also works for this.) Called only when the user leaves the field.
- Use a KeyPress and look for Enter.

A combination of the last two is useful for ''actions'': the action is submitted when the user leaves the field or presses Enter. The first is useful for things that should update every character, notably autocomplete lists but possibly also related tasks like preloading of ''guessed'' resources or updating other fields.


只需添加事件名称离开文本框,然后为该功能编写功能
just add an event name Leave to the textbox and write the functionality to this funtion


这篇关于验证文本框上输入的textBox值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆