I created a public class and a public sub that contains all the code needed to save my application, and I want to be able to use this sub in other classes. But when I type Call Save.Save() (the first save is the class name, the second the sub name), I get this error: "Reference to a non-shared member requires an object reference."
What am I doing wrong? This worked for public variables...
Thanks in advance!
Here's the formating of my code...
THE SUB:
Public Class Save
Public Sub Save()
My.Settings.Variable = Class.Variable
My.Settings.Variable2 = Class.Variable2
[...]
My.Settings.Save()
MessageBox.Show("Save successful", "Save")
End Sub
CALLING THE SUB:
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
Call Save.Save()
End Sub