M
Mark Rae
Hi,
Is there any way to return the name of the class and/or function in which
the code is currently executing? E.g. if I had a button called cmdMyButton
on a Form called frmMyForm.cs, could I write something like this in the
button's Click event?
private void cmdMyButton_Click(object sender, System.EventArgs e)
{
string strClassName = <code to return frmMyForm>
string strFunctionName = <code to return cmdMyButton_Click>
MessageBox.Show("Code is currently executing the function " +
strFunctionName + " in the class " + strClassName);
}
Any assistance gratefully received.
Mark Rae
Is there any way to return the name of the class and/or function in which
the code is currently executing? E.g. if I had a button called cmdMyButton
on a Form called frmMyForm.cs, could I write something like this in the
button's Click event?
private void cmdMyButton_Click(object sender, System.EventArgs e)
{
string strClassName = <code to return frmMyForm>
string strFunctionName = <code to return cmdMyButton_Click>
MessageBox.Show("Code is currently executing the function " +
strFunctionName + " in the class " + strClassName);
}
Any assistance gratefully received.
Mark Rae