Public Class Start
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objMyMeni As New Meni ' This Loads a new instance of the Meni form
Dim objMyNazivG As New NazivG ' This creates an instance of the NazivG object/class
objMyNazivG.ZazeniP(objMyMeni) ' This calls the ZazeniP Sub to change Button1 on the instance of the Meni form that I pass in as a parameter for that Sub
objMyMeni.Show() ' Finally I Show the instance of the Meni form, complete with its changes
End Sub
Private Sub Start_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
... ' And in a different Form Class that I added to the project:
Public Class Meni
Private Sub Meni_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' No code in here. All of the code has been moved to the Start's Button1_Click event handler.
End Sub
End Class
Public Class NazivG
Public Sub ZazeniP(ByVal objForm As Meni)
objForm.Button1.Text = "Besedilo"
End Sub
End Class