How to invoke an object method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

How can I invoke the "Text1_LostFocus()" method within the "Button1_Clik()"
method? Or wath parameters should I pass?

Thanks in advance.
 
You can pass simply call it this way:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Text1_LostFocus(Nothing, Nothing)
End Sub
 
I would suggest not calling event handlers directly. That is bad
programming style. Rather, you should have some methods that handle all the
functionality that you desire. Then have each even handler call those
methods as appropriate.
 
Man, what a simple solution!!! I've being looking in Help, traying to
understand Delgates, Event Handlers, etc. You save me a lot of work.

¡Thanks a lot! Regards from México.

Fernando Olvera


"gaidar" escribió:
 
Back
Top