问题描述
VB.Net Express2008.Windows窗体应用程序.应用程序框架工作已禁用.
以下是我的代码:
模块Module1
子main()
Dim frm1作为新Form1
frm1.Show()
Dim xl作为Microsoft.Office.Interop.Excel.Application
xl = CreateObject("Excel.Application")
xl.Visible = True
frm1.Hide()
结束子
终端模块
我想在打开Excel时显示等待消息.
表格显示不正确.所有标签和文本框都显示为孔",而不显示桌面中的文本.
VB.Net Express 2008. Windows forms application. Application frame work disabled.
Following is my code:
Module Module1
Sub main()
Dim frm1 As New Form1
frm1.Show()
Dim xl As Microsoft.Office.Interop.Excel.Application
xl = CreateObject("Excel.Application")
xl.Visible = True
frm1.Hide()
End Sub
End Module
I want to show a Wait message while Excel is being opened.
The form does not show properly. All the labels and text boxes show as ''holes'' displaying the desktop instead of text inside it.
推荐答案
Dim frm1 As New Form1
Application.Run(frm1)
Application.Run是一个阻塞调用,因此在关闭表单之前,不会执行任何代码.
Application.Run is a blocking call, so no code after it will execute until the form is closed.
这篇关于Form.Show无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!