Solved

Accessing controls / subroutines between two forms...

Posted on 2004-09-23
5
133 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 86

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 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