Results 1 to 2 of 2

Thread: Where am I?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2009
    Posts
    26

    Where am I?

    hi,

    does anyone know a function/variable which tell me which sub/function is running at the moment?
    for example, if the variable is XXX then the following will print "Form1_Load" to the screen.


    Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load

    MsgBox(XXX )

    End Sub

    Thanks

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Where am I?

    You'd need to use reflection:
    Code:
    System.Reflection.MethodInfo.GetCurrentMethod().Name
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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