Solved

Accessing controls / subroutines between two forms...

Posted on 2004-09-23
5
128 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now