Private Sub Form_load()
if app.PrevInstance=True then
msgbox "该程序已经启动"
unload me
exit sub
end if
End Sub
博客给出一段代码,用于检测程序是否已启动。若 app.PrevInstance 为 True,即程序已启动,会弹出提示框‘该程序已经启动’,然后卸载当前窗体并退出子程序。
Private Sub Form_load()
if app.PrevInstance=True then
msgbox "该程序已经启动"
unload me
exit sub
end if
End Sub
261

被折叠的 条评论
为什么被折叠?