Hello I'm trying to apply the method described in this URL.
The problem is that the events are not implemented in a standard way.
How can you implement the events ?
I have attach a test project for testing!
Attachment 106417
Printable View
Hello I'm trying to apply the method described in this URL.
The problem is that the events are not implemented in a standard way.
How can you implement the events ?
I have attach a test project for testing!
Attachment 106417
Code:Private Sub Form_Load()
Set Complete = New CPerson
Complete.Init "First", "Last"
End Sub
That's true.
But what if I want to use:
And in Form callCode:Public Function New_CPerson(FirstName As String, LastName As String, Optional ID As Variant, Optional BirthDate As Variant) As CPerson
Set New_CPerson = New CPerson
New_CPerson.Init FirstName, LastName, ID, BirthDate
End Function
Then how the Event will be Raised ?Code:Call New_CPerson ("First", "Last")
SEE The following way to raise event
And to know more about raising event see the following link .hope it might help.Code:
public withEvents New_cperson 'this is the way to raise the event
Public Function New_CPerson(FirstName As String, LastName As String, Optional ID As Variant, Optional BirthDate As Variant) As CPerson
Set New_CPerson = New CPerson
New_CPerson.Init FirstName, LastName, ID, BirthDate
End Function
http://stackoverflow.com/questions/1...n-event-in-vb6
http://www.developer.com/net/vb/arti...al-Basic-6.htm
Thanks !