Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VB.NET how to determine what sub or function called the current sub or function

Posted on 2010-01-06
2
Medium Priority
?
543 Views
Last Modified: 2013-11-07
I have a situation where I need to be able to know what sub or function called the sub or function I'm currently in.  Is their any way to determine the parent method in VB.NET?
0
Comment
Question by:whitefoxdennet
2 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 2000 total points
ID: 26190024
You should be able to get at it using the current execution stack:
Dim method As System.Reflection.MethodBase = New StackTrace().GetFrame(1).GetMethod()
MessageBox.Show(method.Name)

Open in new window

0
 

Author Closing Comment

by:whitefoxdennet
ID: 31673450
Exactly what I needed!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
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…
Suggested Courses
Course of the Month20 days, 17 hours left to enroll

810 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