Using With Statement

trisolve

Newcomer
Joined
Nov 30, 2003
Messages
11
I have 1 module with a public function and 1 main form. The public function in the module is called GetNewSchedule(). I want to change a value of a linklabel in my main form by calling GetNewSchedule() function that is currently in my module. How do I use the WITH statement in my module to accomplish this (changing text values of link label in main form). Thanks a lot!
 
you can put a reference to Form1 in the Sub's constructor of your module , then call it like this ....
Visual Basic:
'/// the Module ....
Module Module1

    Public Sub GetNewSchedule(ByVal frm As Form1)
        Dim something As String = "something else"
        '/// do some stuff 
        frm.Label1.Text = something
    End Sub

End Module
Visual Basic:
'/// the Form....
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        GetNewSchedule(Me)
    End Sub
 
Back
Top