Solved

Accessing controls / subroutines between two forms...

Posted on 2004-09-23
5
130 Views
Last Modified: 2010-04-23
I have a SubMain located in a seperate module.

I have a startup splash page thats loaded as a .showdialog.

I have a device I'm controlling and placing the status of this device on the splash page.

if that device status changes, while on the splash page, I want to update it with the new status...

so a module would need to access an already displayed form that it didn't directly call...

I'd really appreciate any help I could get....

          - Jayson
0
Comment
Question by:Mr_ComputerTech
5 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 250 total points
ID: 12137699
Make your module look something like this:

    Module Module1

        Public mySplash As mySplashFormName

        Public Sub main()
            mySplash = New mySplashFormName
            mySplash.ShowDialog()
        End Sub

    End Module

Since mySplash is declared as Public in a module, it can be accessed from anywhere.

Regards,

Idle_Mind
0
 
LVL 18

Assisted Solution

by:DotNetLover_Baan
DotNetLover_Baan earned 250 total points
ID: 12140075
Declare all the Forms as "Public" in the module. Create object with "New" keyword.

    Module Module1

        Public F1 As New Form1()
        Public F2 As New Form2()
        Public F3 As New Form3()

        Public Sub main()
            F1.ShowDialog()
        End Sub

    End Module
======================
Now make the Subroutines you want to access, "Friend" or "Public" . Select the controls you want to access, go to the properties, set the "Modifiers" property to "Friend" or "Public".
Now you can access them from any other form you want.

-Baan
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question