Home All Groups Group Topic Archive Search About

pass my.application object

Author
4 Aug 2006 9:08 PM
Larry
Is it possible to pass the my.application object or the my.computer
object to another class, or a class within a DLL?

Using VB.NET in VS.2005

Thanks in Advance,

Laurence

Author
5 Aug 2006 7:06 PM
Terry
Don't see why not.  This works (simple form with 1 button and 1 label):

Imports Microsoft.VisualBasic.ApplicationServices

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
   Dim ao As windowsformsapplicationbase
   ao = My.Application
   foo(ao)
End Sub

Private Sub foo(ByVal App As WindowsFormsApplicationBase)
Label1.Text = App.ToString
End Sub
End Class
--
Terry


Show quoteHide quote
"Larry" wrote:

> Is it possible to pass the my.application object or the my.computer
> object to another class, or a class within a DLL?
>
> Using VB.NET in VS.2005
>
> Thanks in Advance,
>
> Laurence
>