I have an application that has an MDI main page. I would like to open up
multiple non-modal forms for some of the items within that MDI application.
Essentially, I want to open SDI forms from and MDI main application. I have
the forms open, but they don't open up on top and with focus. I need to know
how to have them open on top with focus. Here is the code I have.

Dim exists As Boolean = False
For Each f As Form In My.Application.OpenForms
If f.Tag = nodeTag.Substring(1) Then
exists = True
f.Activate()
End If
Next
If Not exists Then
Dim act As New frmActivities
act.Tag = nodeTag.Substring(1)
act.Show()
act.Activate()
End If

Re: Open Non-Modal Form from MDI Application by Vijay

Vijay
Tue Apr 04 22:23:26 CDT 2006

Eric

What you have should work, what is not working for you?

VJ

"Eric" <Eric@discussions.microsoft.com> wrote in message
news:A03D5523-2297-4B92-B8A0-9C7F5FBC75B2@microsoft.com...
>I have an application that has an MDI main page. I would like to open up
> multiple non-modal forms for some of the items within that MDI
> application.
> Essentially, I want to open SDI forms from and MDI main application. I
> have
> the forms open, but they don't open up on top and with focus. I need to
> know
> how to have them open on top with focus. Here is the code I have.
>
> Dim exists As Boolean = False
> For Each f As Form In My.Application.OpenForms
> If f.Tag = nodeTag.Substring(1) Then
> exists = True
> f.Activate()
> End If
> Next
> If Not exists Then
> Dim act As New frmActivities
> act.Tag = nodeTag.Substring(1)
> act.Show()
> act.Activate()
> End If