pass my.application object

  • Thread starter Thread starter Larry
  • Start date Start date
L

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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top