惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Know Your Adversary
Know Your Adversary
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
F
Fortinet All Blogs
B
Blog
罗磊的独立博客
宝玉的分享
宝玉的分享
Vercel News
Vercel News
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
P
Proofpoint News Feed
T
Threatpost
Security Latest
Security Latest
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Stack Overflow Blog
Stack Overflow Blog
I
Intezer
P
Privacy International News Feed
D
Docker
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
M
MIT News - Artificial intelligence
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
Lohrmann on Cybersecurity
Google DeepMind News
Google DeepMind News
The Last Watchdog
The Last Watchdog
A
Arctic Wolf
IT之家
IT之家
S
SegmentFault 最新的问题
S
Securelist
博客园 - 叶小钗
N
News and Events Feed by Topic
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
Engineering at Meta
Engineering at Meta
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - Franky
GbyAI
GbyAI
AI
AI
Y
Y Combinator Blog
WordPress大学
WordPress大学
Latest news
Latest news
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
N
News | PayPal Newsroom
The Cloudflare Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
I
InfoQ

博客园 - 孙英雄

C# 窗体抖动 “嵌入式资源”的调用 - 孙英雄 - 博客园 SQL2000与Oracle的分布式操作 只能输入数字的TextBox---补充 DevExpress7.3.4部分控件继承后无法编辑解决方案 Mssql安全设置 .NET中如何生成静态页 - 孙英雄 - 博客园 ASP.NET跨页面传值技巧总结 预报:卡巴斯基v6.0个人版KEY获取器---修正版 - 孙英雄 - 博客园 动态读取App.Config WEB开发调试利器:Firebug SQL函数 关注SharpDevelop的一些问题 又一款Auto病毒专杀工具,可解决双击无法打开盘符的问题 Office2007体验及下载 简单讲述基于SQL SERVER 分页的存储过程 Access中的模糊查询 - 孙英雄 - 博客园 DataGrid控件排序方法 Asp.net中的常用小技巧
只能输入数字的TextBox
孙英雄 · 2007-12-14 · via 博客园 - 孙英雄

代码如下:

private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            
if(!char.IsDigit(e.KeyChar)) e.Handled = true;
            //'\b'是退格键值
            if(e.KeyChar=='\b'||e.KeyChar=='.') e.Handled = false;
        }

TextBox1就只能输入0-9之间的值了

posted @ 2007-12-14 19:55  孙英雄  阅读(45443)  评论(1)    收藏  举报

刷新页面返回顶部