当前注册人数155278人 邮箱: 密码: 注册新用户 忘记密码
首页 C/C++/MFC C# ASP.NET VB.NET MATLAB   站内搜索 BBS讨论社区 下载代码说明/积分规则
为什么要注册?

1. 可以直接免费从本站下载代码,防止邮件发送不到您的邮箱,或登录不了国外网站

2. 可以设定关键字,当有您关心的代码收录时,邮件通知您

3. 对这里的代码进行评分和评论

4. 可以和大家一起分享你的源代码,得到更多的建议

A Self-validating Textbox for Key Press

自动验证(限制)键盘输入的文本框控件源代码

2008年01月17日
VB, Windows, .NET, .NET 2.0, Visual Studio, Dev
这是一个VB.NET开发的textbox控件,通过它你可以设定键盘的输入格式,在用户点击键盘的时候,这个文本框会自动进行验证,从而防止用户输入的格式不正确。比如,你可以限制用户输入的是一个日期,或者数字等等。
 
相关知识
If Char.IsNumber(e.KeyChar) = False Then
    If e.KeyChar = CChar(DSep) Then
        If Me.Text.Contains(DSep) Then '


            e.Handled = True           ' Allows only one decimal separator


        End If                         '


    Else
        e.Handled = True
    End If
End If
源代码原文下载:
A Self-validating Textbox Often, it is necessary to control the input of a textbox to maintain the successful functioning of an application, particularly those involving accounting and databases. This textbox controls what the user can type into it. It does this by validating the input character on KeyPress. It has nine modes that are all useful in different situations and can be changed via the ValidationFormat property in design or runtime.

源码图片

从本站下载附件及源代码(1个附件,已经成功下载151次)

最值得关注的外文源代码

Doc2Txt
Custom TextBox that Delays the TextChanged Event
AJAX Fisheye List Widget
Ajax Tabs Content Script (v 2.0)
评论(评论是增加积分的一个有效途径)
字数在300字内
请如实评论
本源代码共评论32次,此处显示最近16次评论! 查看所有评论

乐尚  2009年06月11日
好的
冉冉  2009年06月09日
en. 不错
longge  2009年05月29日
很有用的东西
闲云孤鹤  2009年02月25日
有意思!
xuyl_gc  2008年12月30日
kan kan
shier  2008年12月26日
继续
shier  2008年12月26日
有意思!
shier  2008年12月26日
不错!
dnlrh  2008年12月17日
xiexie
liqbzy  2008年12月06日
不错,效果很好
Atongmu  2008年11月25日
需要
vencent2006  2008年11月21日
有点启示
波波  2008年10月28日
上帝书房  2008年10月18日
hao
有心  2008年09月23日
有几种验证方式啊
有心  2008年09月23日
有几种验证方式啊
字数在300字内
请如实评论
CopyRight (C) codesoso.com 2007-2009 All Rights Reserved   免责声明
京ICP备08011023号