Am building a class Called MailClass which I need to Raise event called ShowInfo each time I have any Messages.
In Vb.Net You simple go to class Modules and write Public Event ShowInfo(ByVal MsgReport As String).
To send any Messagse I would write RaiseEvent Showinfor("hai")
Then to consume it in a form I would write Dim WithEvents ReportError As MailClass
Automatically it will gives me a procedure called
Public Sub MsgReport _AnyError(ByVal ReportError As String)
MsgBox ReportError
End Sub
Please How can I do all these in C#
In Vb.Net You simple go to class Modules and write Public Event ShowInfo(ByVal MsgReport As String).
To send any Messagse I would write RaiseEvent Showinfor("hai")
Then to consume it in a form I would write Dim WithEvents ReportError As MailClass
Automatically it will gives me a procedure called
Public Sub MsgReport _AnyError(ByVal ReportError As String)
MsgBox ReportError
End Sub
Please How can I do all these in C#
Scott LyslePosted Mar 19, 2007, 1:18 AM
http://www.c-sharpcorner.com/UploadFile/scottlysle/PassData01142007013005AM/PassData.aspx?ArticleID=e7134953-414b-4bdc-b584-bb304fa903b1