By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,490 Members | 3,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,490 IT Pros & Developers. It's quick & easy.

Know the caller from within function...

P: n/a
Hi,

Is there a way to programmatically find out the caller of your function? For
example, let's say I have a function called MyFunction(), and I want to
debug print the caller of this function from within this function.

Private Sub MyFunction
// debug print the name of the caller
End Sub

What I actually want to accomplish by this is, I have a routine that handles
multiple events of a control, as shown below.

Private Sub Button1_Clicks(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click, Button1.DoubleClick

End Sub

I need to know, for which event the handler is being called.

Appreciate any inputs!

thanks!
-Yasutaka

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Take a look Environment.StackTrace

Nick

----- Yasutaka Ito wrote: ----

Hi

Is there a way to programmatically find out the caller of your function? Fo
example, let's say I have a function called MyFunction(), and I want t
debug print the caller of this function from within this function

Private Sub MyFunctio
// debug print the name of the calle
End Su

What I actually want to accomplish by this is, I have a routine that handle
multiple events of a control, as shown below

Private Sub Button1_Clicks(ByVal sender As System.Object, ByVal e A
System.EventArgs) Handles Button1.Click, Button1.DoubleClic

End Su

I need to know, for which event the handler is being called

Appreciate any inputs

thanks
-Yasutak
Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.