把以下代码放在第一个窗体的FORM_Load事件中: If App.PrevInstance = True Then Call MsgBox("这个程序正在运行!", vbExclamation) End End If