我在窗体的load事件中加入如下代码,可运行的时候提示出错:
Dim t As String
If App.PrevInstance = True Then
t = App.Title
Call MsgBox("Label已运行! ", vbOKOnly + vbInformation, "错误")
App.Title = "111"
AppActivate t
End
End If
运行时错误'5':无效的过程调用或参数
Dim t As String
If App.PrevInstance = True Then
t = App.Title
Call MsgBox("Label已运行! ", vbOKOnly + vbInformation, "错误")
App.Title = "111"
AppActivate t
End
End If
运行时错误'5':无效的过程调用或参数
我不知道你 这句干什么,App.Title = "111"把他去掉就不会错。还有AppActivate功能有限,你想激活你前面的窗口实例,可以参考http://community.csdn.net/Expert/topic/5008/5008779.xml?temp=.081402
将激活新打开的这个实例,而不是之前已运行的那个
我也运行了,没有问题..........莫非是传说中的rpwt开个玩笑哈,活跃一下气氛
________________
??
App.Title = "111"
AppActivate t===============
这是你的几条语句, 你放到ide中顺序执行没问题。
因为ide中那个title是模拟的, 他模拟的有问题
你appactive早其的app.title也没问题, 虽然实际上已经成了111了但是编成exe上面的就执行不过去了, 因为app.title已经改变了。