Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何检查MDI子窗体是否已打开_Vb.net - Fatal编程技术网

Vb.net 如何检查MDI子窗体是否已打开

Vb.net 如何检查MDI子窗体是否已打开,vb.net,Vb.net,我有一个包含MDI父窗体和子窗体的应用程序。我必须在网格中显示不同类型的数据。因此,我使用网格创建了一个公共表单并传递数据集。现在,如何检查特定数据表单是否已打开。这是我的密码 Public Function FindMdiChild(ByVal Title As String) As Boolean If Application.OpenForms.Count = 0 Then Exit Function For Each t As Form In Applicat

我有一个包含
MDI
父窗体和子窗体的应用程序。我必须在网格中显示不同类型的数据。因此,我使用网格创建了一个公共表单并传递数据集。现在,如何检查特定数据表单是否已打开。这是我的密码

Public Function FindMdiChild(ByVal Title As String) As Boolean
       If Application.OpenForms.Count = 0 Then Exit Function
       For Each t As Form In Application.OpenForms
           If t.Text.ToString = Title.ToString Then
               t.Activate()
               Return True
           End If
       Next
End Function
问题是有时它会卡在这一特定行上“
如果t.Text.ToString=Title.ToString,那么


请帮助我解决此问题。

此代码位于何处?它是在父窗体中还是在其他地方?它在模块类中。我建议@Ian有什么区别?这是一个重复的问题:(当我搜索这个特定问题时,我发现这是第一个链接——也许下次再做一点家庭作业)另外,代码是在VB中,c标记应该被删除。