jiewa replied on 16-Feb-09 04:18 AM
Hi John,

Thank you for posting.

Let me give the straightforward answer first:

You can use System.Windows.Forms.Application.OpenForms to get the same
result.

VB.NET Code sample:

For Each f As Form In System.Windows.Forms.Application.OpenForms
MessageBox.Show(f.Text)
Next

Now let me explain a little bit more. Actually all the
My.Application.OpenForms property does is simply return the result from
System.Windows.Forms.Application.OpenForms.

When we enable the Application Framework for a VB.NET WinForm project, we
can access My.Application object, which is inherited from
WindowsFormsApplicationBase class located in
Microsoft.VisualBasic.ApplicationServices namespace (Assembly
Microsoft.VisualBasic.DLL). If you can find this assembly file and open it
using .NET Reflector or ILDasm, get to the source of
WindowsFormsApplicationBase.OpenForms property, you'll see a simple line of
code like this (which explains what I wrote in code):

Public ReadOnly Property OpenForms As FormCollection
Get
Return System.Windows.Forms.Application.OpenForms
End Get
End Property

So you can use System.Windows.Forms.Application's OpenForms property no
matter the Application Framework is enabled or not.

Please kindly let me know if I answered your question clearly, and if you
have any further questions on this topic, also feel free to post here.

Regards,

Jie Wang (jiewan@online.microsoft.com, remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.




jiewa replied on 18-Feb-09 09:30 PM
Hello John,

Would you mind letting me know if the
System.Windows.Forms.Application.OpenForms property is working for you?

If  you have any further questions regarding this issue, please feel free
to let me know. I'd be happy to help.

Thanks,

Jie Wang (jiewan@online.microsoft.com, remove 'online.')

Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 2 business days is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions. Issues of this
nature are best handled working with a dedicated Microsoft Support Engineer
by contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
John replied on 23-Feb-09 04:31 PM
This works perfect!!!