如何验证C#中更改的datetimepicker值 [英] how to validate datetimepicker value changed in C#

查看:385
本文介绍了如何验证C#中更改的datetimepicker值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此代码



代码:

  if (datetimepicke.ValueChanged == true)

错误:

只能出现 手边 + = - =





得到此错误

解决方案

你不能做一个对事件的逻辑比较。



ValueChanged是一个控件上的事件而不是属性。



因此你的错误。


不要多次发布同一个问题。我已在这里回答:



如何查明是否日期时间选择器值是否更改? [ ^

i am using this code

code:

if (datetimepicke.ValueChanged==true)

Error:

can only appear on the left hand side of += or -=



getting this error

解决方案

you cannot do a logical comparison on an event.

ValueChanged is an event on the control not a property.

Hence your error.


Don''t post the same question more than once. I have already answered it here:

How to find out if datetime picker value is changed or not?[^]


这篇关于如何验证C#中更改的datetimepicker值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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