起步软件技术论坛-X3

 找回密码
 立即注册
搜索
查看: 98|回复: 2

【结】OnValidate**

[复制链接]
发表于 2009-2-12 11:04:28 | 显示全部楼层 |阅读模式
DataSet.FieldByName('EndDate').OnValidate :=IfMoreDay;  

请问OnValidate是什事件?
回复

使用道具 举报

发表于 2009-2-12 11:19:02 | 显示全部楼层
这个是delphi tField的事件:
Occurs just before the data is written to the record buffer.

type TFieldNotifyEvent = procedure(Sender: TField) of object;
property OnValidate: TFieldNotifyEvent;

Description

Write an OnValidate event handler to validate changes made to the data in the field, just before the data is written to the current record buffer. The EditMask property allows validation of the data on a character by character basis while it is being entered by the user. OnValidate allows an application to validate the data as a whole.

When the value of a field component is assigned programmatically, validation by the EditMask is bypassed, since there is no data-aware control to enforce adherence to the mask. OnValidate allows an application to validate such data before it is posted to the database table.

To reject the current value of the field from the OnValidate event handler, raise an exception.

When writing the value of a field to the current record buffer, the following steps occur:

1        The OnValidate event handler is called to validate the data.
2        If the OnValidate event handler does not raise an exception, the data is written to the current record buffer.
3        If writing the data does not raise an exception, the OnChange event handler is called to allow a response to the change.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-12 11:46:29 | 显示全部楼层
谢谢!结贴吧!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Justep Inc.

GMT+8, 2025-7-28 00:38 , Processed in 0.036765 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表