views:

30

answers:

2

I want some event handling functions to only be able to be accessed via raised events and not called from the program.

Such as:

Public Event Event1(Byval TheText as string)
private sub Event1Handler(Byval TheText as string) handles me.Event1
   msgbox("Hi")
end sub

I want this code to execute the function:RaiseEvent Event1("Hi")

But I do not want this code to execute the function:Event1Handler("Hi")

Is there a declaration or some other way to accomplish this?

+2  A: 

There's no other way than embed this logic into a lambda expression.

Anton Gogolev
+1  A: 

Right click the function and click "find all references". Do this periodically to make sure nothing references it directly

hamlin11