Hello
I want to find which button on my form caused it to close through the Form_Closing event. In the button's Click event i have this:
Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub
And in the Closing event:
Private Sub frmCandDetails_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
now when i use sender.gettype here i always get the form itself...how can i go one step back to see who caused this event? VB6 had a QueryUnload method that is non existent in .NET. Could it be done through Delegates?
I want to find which button on my form caused it to close through the Form_Closing event. In the button's Click event i have this:
Private Sub btnClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClose.Click
Me.Close()
End Sub
And in the Closing event:
Private Sub frmCandDetails_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
now when i use sender.gettype here i always get the form itself...how can i go one step back to see who caused this event? VB6 had a QueryUnload method that is non existent in .NET. Could it be done through Delegates?