在tooltips表单的LOAD事件中录入以下代码:
IF !FILE(′tooltips.dbf′)
CREATE TABLE tooltips (tooltip c(200))
APPEND BLANK
REPLACE tooltips.tooltip WITH
″未添加操作提示内容,请打开数据表并添加数据.″
IF USED(′tooltips′)
USE
ENDIF
ENDIF
SELECT 0
USE tooltips
IF RECCOUNT() < 1
APPEND BLANK
REPLACE tooltips.tooltip WITH
″这是第一个操作提示,按下一个按钮可显示下一个提示。″
ENDIF
IF FILE(′lasttip.mem′)
RESTORE FROM lasttip ADDITIVE
IF TYPE(′gl—lasttip′) != ″N″
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ELSE
IF gl—lasttip >= RECCOUNT(′tooltips′)
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ELSE
gl—lasttip = gl—lasttip + 1
SAVE ALL LIKE gl—lasttip TO lasttip
ENDIF
ENDIF
ELSE
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ENDIF
GO gl—lasttip
IF FILE(′lasttip.mem′)
RESTORE FROM lasttip ADDITIVE
IF TYPE(′gl—lasttip′) != ″N″
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ELSE
IF gl—lasttip >= RECCOUNT(′tooltips′)
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ELSE
gl—lasttip = gl—lasttip + 1
SAVE ALL LIKE gl—lasttip TO lasttip
ENDIF
ENDIF
ELSE
gl—lasttip = 1
SAVE ALL LIKE gl—lasttip TO lasttip
ENDIF
GO gl—lasttip
THISFORM.text1.value= tooltips.tooltip
THISFORM.text1.refresh
IF THIS.value = 0
dummyval = 1
SAVE ALL LIKE dummyval TO notip.mem
ELSE
IF FILE(′notip.mem′)
DELETE FILE notip.mem
ENDIF
ENDIF
在“关闭”窗口中录入以下代码:
clea memory tipalready
THISFORM.release
SET CLASSLIB TO tipofday ADDITIVE
IF TYPE(′tipoftheday′)=
″U″ .AND. TYPE(′tipalready′)=″U″
PUBL tipoftheday, tipalready
tipoftheday = CREATEOBJECT(″daystip″)
tipoftheday.text1.value =
″您可按右上角的X框来退出本程序.″
IF .NOT. FILE(′notip.mem′)
tipoftheday.show(1)
ENDI
tipalready = .T.
ENDI
IF .NOT. FILE(′notip.mem′)
tipoftheday.show(1)
ENDI
- 如果用户不选择“程序启动时执行” 这一项,内存文件notip.mem就不存在,此时就显示“每日一贴” 表单,否则就不运行此表单。相应的代码在复选框的Click事件有判断,请大家参考上面的代码。