Results 1 to 3 of 3

Thread: adding events

  1. #1

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    adding events

    hey, ive made and activeX control, i now want to add a event to it. i want this to be called onclick, which runs when its clicked. how is it done. ive been to add proccedure and added the event, it added
    VB Code:
    1. public Event onClick()

    but thats all? any help would be great

    thanks

  2. #2
    New Member
    Join Date
    Sep 2002
    Location
    Delray Beach FL
    Posts
    2

    use RaiseEvent

    After you add the event, you have to use the RaiseEvent keyword in the function or sub that you want the event to happen in

    Public Event Slap()

    ' mock function
    Public Function MakeMistake()
    RaiseEvent Slap


    In your client code, you can use this event like any other (onclick, etc) for your ActiveX control:

    Public Sub YourActiveXControl_Slap()

  3. #3

    Thread Starter
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    thanks

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