In my MainForm i have this code :
Imports System.Math
Imports MySql.Data.MySqlClient
Imports System.Data.DataTable
Imports System.Data.SqlClient
Public Class MainForm
Public variable As String
Public Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
OpcDaCom1.Subscribe("adress_of_opc", 1, 0, AddressOf test)
End Sub
Public Sub test(sender As Object, e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
variable = e.Values(0)
End Sub
End Class
And i want to use a MainForm + a other new class in my program that i have :
1 - the opc adress in the MainForm:
Public Sub MainForm_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
OpcDaCom1.Subscribe("adress_of_opc", 1, 0, AddressOf test)
End Sub
2 - call the sub test from the other new class
call the function "sub test"
3 - the new class that i need :
Public Sub test(sender As Object, e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs)
variable = e.Values(0)
End Sub
so my question is ; how can i call the function in the MainForm ?