?
Solved

OCX Raise Event

Posted on 2004-03-26
2
Medium Priority
?
422 Views
Last Modified: 2013-11-13
I was wondering, How do you raise an event. Such as how the winsock Control has subs that get called. Winsock1_DataArrival.

How would I add a sub called "StartChange" to my OCX that the user can enter their code into and will be triggered.



-Brian
0
Comment
Question by:BrianGEFF719
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 27

Accepted Solution

by:
Dabas earned 2000 total points
ID: 10691039
Hi BrianGEFF719:
You declare your event at the top of your class

Public Event MyEvent1(Parameter1 As String, Parameter2 As Integer, ...)

When you want an event to occur within your program, you Raise the event

Public Sub MyProc
      RaiseEvent "hello", 5

Inside your calling module, you have to declare a variable as "With Events"

Dim WithEvents oMyClass as cMyClass

Dabas
0
 
LVL 19

Author Comment

by:BrianGEFF719
ID: 10691133
Thanks, let me try it out and get back to you.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question