Solved

How to use Events??

Posted on 1998-10-09
2
166 Views
Last Modified: 2010-04-30
I am a total newbie to VB Programming, so please bare with me....  I have a program, and when a particular thing occurs, I want an event to be Raised(so that another program knows to do something).  How do I raise an event(that isn't something like onclick().)  Now, how can I have another vb program listen for this event, and carry out some actions if this event is actually raised?
Thanks, hope this makes sense.
0
Comment
Question by:sbishop
[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 2

Expert Comment

by:Veroland
ID: 1439035
It sounds like you want to use something like DDE. Dynamic Data Exchange
0
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1439036
sbishop
A event is araised by a component in your (such as a control) program to indicate something happed to it (like click), so you can add code in the event to do what you like when the event happens.  This is because you don't know or don't care what's going on inside the control until the event is happening. You don't not raise an event (so to speek) in your program, because you know exactly what is going on in your program.

What you talking about another program, it is a different story. The 2nd program may not care what is going on in the first, only when the "event" occur.  So what you can do is to make the first program as a component of the 2nd in the form of ActiveX (Control, Dll, EXE).  In that case you can raise an event.
To raise a event, you first tell VB that your control(say) has event using the WithEvent
Example: Private WithEvents myControl As Someobject

then you defined what event:
Public Event ChangeText()

and finally when it's time to raise it, using:RaiseEvent ChangeText


It is a little  complecated. So you may look at the DDE, it is much simpler. But DDE is a deminishing technology and it is not as reliable.

Regards
Dalin

 



0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using Access 8 93
Add and format columns in vb6 7 83
transition to visual .net from vb6 5 80
add criteria to query in VB, Access 2003 2 47
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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