首页 > 代码库 > 文本框和列表框的click事件

文本框和列表框的click事件

#region 文本框和列表框的click事件
        private void tbORcbb_click(object sender, EventArgs e)
        {
            if (typeof(TextBox).IsInstanceOfType(sender))
            {
                if (!ifSelected)
                {
                    ((TextBox)sender).SelectAll();
                    ifSelected = true;
                }
            }
            else if  (typeof(ComboBox).IsInstanceOfType(sender))
            {
                if (!ifSelected)
                {
                    ((ComboBox)sender).SelectAll();
                    ifSelected = true;
                }
            }
        }
        #endregion