0

Hi anyone could help me...

let say i have a button click event
example :

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Call Save_Action()
End Sub

then i can call the event using this
btnSave_Click(sender, e)

now my question is...i use LabelLink

Private Sub lnkFromPR_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkFromPR.LinkClicked
' do something
End Sub

how i call this event...i try this but cant work
Call lnkFromPR_LinkClicked(sender, e)

2
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by jianhe99
0

..i try this but cant work Call lnkFromPR_LinkClicked(sender, e)

I'm sure that e is of type System.EventArgs but now it should be of type LinkLabelLinkClickedEventArgs

Here's one way to do it

' Get selected link
Dim thisLink As LinkLabel.Link
' Just take the first link
thisLink = LinkLabel1.Links.Item(0)
' Call event handler
LinkLabel1_LinkClicked(LinkLabel1, New LinkLabelLinkClickedEventArgs(thisLink))

You're calling event handlers like they were procedures, you should do some redesigning for your program's logic.

HTH

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.