Win32Exception 未处理 - 单击退出按钮时 Visual Basic [英] Win32Exception was unhandled - Visual Basic when clicking on the exit button
问题描述
我正在使用 Microsoft Visual Studio 2010 32 位高级版 (Microsoft Visual Basic 2010) 构建表单.当我编译代码时没有任何错误,但是每当我单击退出按钮时,它都会给我以下消息:
I'm building a form using Microsoft Visual Studio 2010 32-bit Premium (Microsoft Visual Basic 2010). When I compile the code there aren't any errors, but whenever I click on the exit button it gives me this message:
Win32Exception 未处理"创建窗口句柄时出错".
Win32Exception was unhandled" "error creating window handle".
此错误的原因是什么,如何修复?
What is the reason for this error and how can it be fixed?
我在大学的实验室中编写了这段代码,并且运行良好.但是当我在家里运行它时,我收到了这个错误.
I did this code in the university's lab, and it worked fine. But when I run it at home, I'm getting this error.
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 位高级版.
I'm using Windows 8 64-bit and Microsoft Visual Studio 2010 32-bit Premium.
推荐答案
您不会调用 End
来退出程序.它是 Application.Exit
或 Me.Close
!
You do not call End
to exit a program. It's Application.Exit
or Me.Close
!
这篇关于Win32Exception 未处理 - 单击退出按钮时 Visual Basic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!