我正在使用 Microsoft Visual Studio 2010 32 位高级版 (Microsoft Visual Basic 2010) 构建表单。当我编译代码时没有任何错误,但是每当我单击退出按钮时,它都会给我以下消息:
Win32Exception was unhandled" "error creating window handle".
此错误的原因是什么以及如何修复?
我在大学实验室编写了这段代码,效果很好。但是当我在家运行它时,我收到此错误。
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
If MsgBox("Are you sure you want to exit the program?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo) Then
End ' error creating window handle
End If
End Sub
我使用的是 Windows 8 64 位和 Microsoft Visual Studio 2010 32 位 Premium。
最佳答案
您不调用End
来退出程序。它是 Application.Exit
或 Me.Close
!
关于vb.net - 单击退出按钮时未处理 Win32Exception - Visual Basic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18036216/