My in Different Applications

Now that you know how My can be customized, you can easily understand why different kinds of Visual Basic applications have their own customizations, provided by the IDE. For example, Windows Forms applications provide a My.Forms property that allows access to forms instances, as follows:

Dim oneForm As Form1 = My.Forms.Form1

This is mainly due to the support offered in code by the My namespace to the Application Framework feature. This feature allows executing special tasks at the beginning and at the end of the application lifetime, such as showing splash screens or establishing what form is the main application form. In Windows Forms applications the application framework is enabled by default, and you can get ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.