I have a couple of functions I would like to be available across my classes and forms.
Error Logging, Progress Logging, Send Mail and a Message Box helper for debugging.
I know I can define these on my main form called "Main" and then call them in a class as Main.SubName() - but being a lazy bugger, I want to be able to just call them as SubName() without the main form name.
I created a new class here's my code:
Public Class myHelpers
'Message Box Helper - for debugging
Public Shared Sub mbHelper(ByVal lineNumber As Integer, ByVal Task As String, ByVal message As String, ByVal additionalInfo As String)
Dim title As String = "Debug Information"
Dim messageText As String = "Line Number: " & lineNumber & vbCrLf & "Task: " & Task & vbCrLf & "Message: " & message & vbCrLf & "Additional Info: " & additionalInfo
MsgBox(messageText, MsgBoxStyle.OkOnly, title)
In my forms and classes I imported myHelpers - but that did not work, mbHelper is not recognized.
Any ideas what I'm missing? Sorry if this is a simple problem - but I really appreciate the help!!!