vb.net - 单击退出按钮时未处理 Win32Exception - Visual Basic

标签 vb.net visual-studio-2010

我正在使用 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.ExitMe.Close!

关于vb.net - 单击退出按钮时未处理 Win32Exception - Visual Basic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18036216/

相关文章:

MySql.Data.MySqlClient.MySqlException - vb.net

vb.net - 如何在VB.NET中将16位值拆分为两个8位值?

visual-studio-2010 - 在 Visual Studio 2008 中按 F1 时如何在默认浏览器中搜索 MSDN?

c - 在 Visual Studio 2010 中使用 C99 之前的语法

c# - 以编程方式修改现有资源文件

asp.net - 通过 Visual Basic 从网站检索数据

c# - 如果 Google Ads 被屏蔽,我如何显示其他内容?

visual-studio - 明确设置目标平台时未构建新项目

xml - XSLT : Insert new line between two elements in a template

visual-studio - 当远程计算机上未安装 VS 时,使用 CRT 的 DEBUG 版本远程调试应用程序