xeaiow 發表於 2012-8-14 02:30:22

防止多開 - 簡單版

Public Sub CheckExist(fm As Form)
Dim title As String
If App.PrevInstance Then
   title = App.title
   Call MsgBox("文字", vbCritical)
   App.title = ""    '如此才不會Avtivate到自己
   fm.Caption = ""
   AppActivate title 'activate先前就已行的程序
   End
End If
End Sub

Private Sub Form_Load()
Call CheckExist(Me)
End Sub

網路上找到的,自己測試是可以用的

zhi12312 發表於 2012-9-16 22:30:56

0807 發表於 2013-2-7 10:39:58

a0955912521 發表於 2013-2-8 11:43:34

頁: [1]
查看完整版本: 防止多開 - 簡單版