有一个时间控件dtpicker1,当改变的时间小于某一时间后,则弹出提示对话框.
代码如下:procedure myform.dtpicker1.onChange(sender:object)
begin
if dtpicker1.date<otherTime then
begin
msgNotice(1,'当前时间不能小于otherTime','');
exit;
end;
end;
结果是弹出两次对话框.
别人告诉我说设一个全局boolean变量,在程序中做判断就行了.
可是我不想要那么多的全局变量,该如何更改啊?
代码如下:procedure myform.dtpicker1.onChange(sender:object)
begin
if dtpicker1.date<otherTime then
begin
msgNotice(1,'当前时间不能小于otherTime','');
exit;
end;
end;
结果是弹出两次对话框.
别人告诉我说设一个全局boolean变量,在程序中做判断就行了.
可是我不想要那么多的全局变量,该如何更改啊?
解决方案 »
- Delphi postmessage的问题
- 求能导出中文的fastreport
- 小妹初学delphi,请各位大哥帮忙!问几个怎么关于播放音频的问题,先谢谢了!
- 想写一个ACCESS数据库的C/S的应用程序,练练手.不知道那位天使大哥,大姐有资料没送我份!
- 这个通信问题能不能不用网站方式解决?可以多加100分啊!急呀!
- =====请问DELPHI自带的树形控件都有哪些?=====
- When I press Ctrl+A ,I want select all the Items in the Listbox.
- 怎样把字符串中的信息转换为程序代码???
- delphi 6 自带的InstallShield Express 为何不支持中文?怎么办??
- 如何设置Form全屏显示?
- delphi如何把路由 自动断开然后在自动连接上
- 这句代码报错能解决吗
if dtpicker1.Focused and (dtpicker1.date <otherTime) then
begin
msgNotice(1,'当前时间不能小于otherTime','');
end;