Results 1 to 5 of 5

Thread: [RESOLVED] Rising Event in VB6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2011
    Posts
    29

    Resolved [RESOLVED] Rising Event in VB6

    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!
    TestEvents.zip

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: Rising Event in VB6

    Code:
    Private Sub Form_Load()
        
        Set Complete = New CPerson
        
        Complete.Init "First", "Last"
        
    End Sub

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2011
    Posts
    29

    Re: Rising Event in VB6

    Quote Originally Posted by Doogle View Post
    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:

    Code:
    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
    And in Form call

    Code:
    Call New_CPerson ("First", "Last")
    Then how the Event will be Raised ?

  4. #4
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: Rising Event in VB6

    SEE The following way to raise event
    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
    And to know more about raising event see the following link .hope it might help.
    http://stackoverflow.com/questions/1...n-event-in-vb6
    http://www.developer.com/net/vb/arti...al-Basic-6.htm

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2011
    Posts
    29

    Re: Rising Event in VB6

    Thanks !

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width