3
我正在制作一个服务器控制应用程序(简单地用一些按钮来启动/停止服务器) 而当用户想要关闭应用程序时,系统会提示一个确认框。在Visual Basic中的E.cancel循环
Private Sub Form1_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
Dim response As Integer
response = MsgBox("Are you sure you want to stop the server", vbYesNo, "Stop Server ?")
If response = vbYes Then
Shell("cscript ""stop.vbs""", 1)
Close()
Else
e.Cancel = True
End If
End Sub
这就是我现在的代码。 但是,当我启动应用程序并关闭它与X按钮或“关闭窗口”我会提示问题,直到我点击否,然后它将关闭。 这是一个循环,当你第一次点击是时,然后停止。
有人可以帮我解决这个问题吗?
哇,谢谢你没注意到! 我不能投票:D – Ahmed
@艾哈迈德,但你可以接受这个答案:[see here](http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-工作) – sloth
我知道它说等待9分钟我打算在1分钟后现在;) – Ahmed