zoukankan      html  css  js  c++  java
  • combobox和textbox中输入数据为非数字leave时的公用事件,只需要在控件的leave事件中选择本事件即可

    private void tbORcbb_leave(object sender, EventArgs e)
            {
                if (typeof(TextBox).IsInstanceOfType(sender))
                {
                    if (((TextBox)sender).Text.IsNumeric() != true)
                    {
                        ((TextBox)sender).Focus();
                        ((TextBox)sender).SelectAll();
                    }
                }
                else if  (typeof(ComboBox).IsInstanceOfType(sender))
                {
                    if (((ComboBox)sender).Text.IsNumeric() != true)
                    {
                        ((ComboBox)sender).Focus();
                        ((ComboBox)sender).SelectAll();
                    }
                }
            }

  • 相关阅读:
    while 循环 。。
    数据运算,运算符
    字符串常用操作
    列表常用操作
    三级菜单
    杂七杂八
    简单的登陆程序001
    猜年龄游戏
    实现密文输入密码
    使用urllib2打开网页的三种方法
  • 原文地址:https://www.cnblogs.com/swtool/p/3840196.html
Copyright © 2011-2022 走看看