第二个表格未加载

问题描述 投票:0回答:1

我搜索了几个小时并尝试了很多东西但没有成功。

我正在使用 VB.net。我的主表单(Form1)未加载另一个表单(ECR_ECO_Details)。就在几个小时前。不知何故,ECR_ECO_Details 最终出现在“我的项目”文件夹中。我将它拖回到原来的位置,与 Form1 相同的位置。没有错误、警告或喜悦。

此外,我在 Load 和 Shown 事件中有一个 MsgBox。 MsgBox 不存在,所以我的程序甚至找不到第二种形式。

它必须很简单,但这是我第一次使用 Visual Studio。我确信这是 IDE 中的东西,而不是代码。

    Private Sub NewECR_Click(sender As Button, e As EventArgs)
        Dim NewECRForm As New ECR_ECO_Details
        NewECRForm.ShowDialog()
    End Sub

与上面几乎相同的有效代码,相同的结果。曾经工作过。

    Private Sub NewECR_Click(sender As Button, e As EventArgs)
        Using NewECRForm As New ECR_ECO_Details()
            NewECRForm.ShowDialog()
        End Using
    End Sub

蒂亚!

vb.net showdialog
1个回答
0
投票

此代码位于我的 Form1 上,单击按钮,它会加载并显示 frmSSUpdate 和 Close 的 Form1

 Private Sub btnSSDeposit_Click(sender As Object, e As EventArgs) Handles btnSSDeposit.Click
    frmSSUpdate.Show()
    Close()
End Sub
© www.soinside.com 2019 - 2024. All rights reserved.