我正在尝试显示一条等待消息,这实际上是一个表单,而一个长进程正在某个不同的文件中运行。我面临的问题是,一旦进程开始,表单就会消失,但它仍然处于活动状态并正在运行进程
我的代码:
Dim objWait As New frmWaitupdate
Dim strReply As String
Dim ischange As Boolean
Dim obj1 As New MyBO.UpdateSchemaBO()
ischange = obj1.CheckSchemaChanges(Application.ProductVersion.ToString())
If ischange = True Then
lblMsg.Text = "Schema changes found please wait Please wait."
obj1.AddVersionTable(Application.ProductVersion.ToString())
Me.Visible = True
strReply = obj1.UpdateSchema(Me)
If strReply <> "" Then
MessageBox.Show(strReply, "abc")
Else
MessageBox.Show("Schema updated successfully", "abc")
End If
'objWait.Hide()
ElseIf ischange = False Then
MessageBox.Show("No schema changes found", "abc")
End If
End If
随着流程在 UpdateSchema() 中进行,大约需要 30-45 秒才能完成表单消失。有什么方法可以让表单在屏幕上可见,直到我的流程完成?