Skip to content

How can I get the name of last event in VB.NET?

Fatma Nuran Ozcani

Asked Jan 7, 2007, 11:39 PM EST1 answer
Share
LinkedInX
Hello,

My name is Nuran and I am a new in TheScripts.com and a programmer on .NET and I am developing a VB.NET project with windows forms. I need to know how I can obtain the name of a current triggerred event in a such code:


Private Sub dene(ByVal sender As Object, ByVal e As EventArgs) _

Handles btnOne.MouseHover, btnTwo.MouseHover, btnTwo.gotfocus, btnTwo.lostfocus

Dim clickedCtrl As Control

clickedCtrl = DirectCast(sender, Control)


lblDisplay.Text = clickedCtrl.Name ‘.... name of the control ........

'----here I need to know where come here, for example from gotfocus of btnTwo or  lostfocus of '....btnTwo in the list of Handles keyword.


End Sub


Could you please tell me about how I can get the name of last event in VB.NET?


Thanks
 


Nuran

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Well, you can handle this through flag.Set a flag for individual event  and then check for the flag in the method mentioned below and go about it.
    0