如何为DataGridView列创建日期输入掩码(而不是格式)? [英] How do I make a date input mask (not format) for a DataGridView column?

查看:74
本文介绍了如何为DataGridView列创建日期输入掩码(而不是格式)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

向所有人致意,



我是初学程序员使用C#.Net在Visual Studio 2015中开发一个小型WinForms应用程序,需要一个日期输入掩码(不是格式化) )为 在DataGridView的第一列中输入的数字。 我该怎么做? 我真的只需要b $ b即可欣赏一些示例代码。 非常感谢您的所有时间和帮助。



祝你好运,



jcrcarmo

Greetings to all,

I'm beginner programmer developing a small WinForms application in Visual Studio 2015 using C# .Net and need a date input mask (not format) for the  numbers entered in the first column of a DataGridView.  How do I go about doing that?  I'd really appreciate some sample code.  Thank you very much for your all your time and help.

Best regards,


jcrcarmo

推荐答案

您需要验证KeyPress事件的输入并取消任何不合适的按键,
You need to validate input on KeyPress event and cancel any unsuitable key press,


这篇关于如何为DataGridView列创建日期输入掩码(而不是格式)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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