Click event

  • Thread starter Thread starter Tom McLaughlin
  • Start date Start date
T

Tom McLaughlin

Within my program I need to call a click event belonging to
a LinkLabell. I have read about Raise Events and I'm still
unable to understand this concept. The Name of the Event
is LinkLabel1_LinkClick. If someone could explain how to
call this event using the actual event name and not myobj,
myclass, my... this and that I would great appreciate it.

Thanks

TM
 
LinkLabel1_LinkClick is just a function that gets called when the even is fired. Like any other function, you can call it directly.
However, the exact syntax depends on where you are calling the function from. If you are calling the function from inside the form's class code, you can call it directly. If you are calling the event handler function from another module or form, you will need a reference to the form containing the LinkLabel1_LinkClick function, and you may need to change the access modifier of the function from Private to Friend.
However, if you have common code that needs to be called from within your event handler function (LinkLabel1_LinkClick) and somewhere else, I suggest writing that code in a dedicated function in a module elsewhere. Then, you can easily call the function from inside the event handler function or any other place in your code.

-Rob Teixeira [MVP]
Within my program I need to call a click event belonging to
a LinkLabell. I have read about Raise Events and I'm still
unable to understand this concept. The Name of the Event
is LinkLabel1_LinkClick. If someone could explain how to
call this event using the actual event name and not myobj,
myclass, my... this and that I would great appreciate it.

Thanks

TM
 
Back
Top