Heres my sub:
Dim onThisTable as String ="Name"
Private Sub skill_mouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.MouseHover, button2.MouseHover, panel1.MouseHover, panel2.MouseHover, pbox1.MouseHover
descriptionLabel.Text = dbClass.getDescription(sender.Text, onThisTable)
End Sub
Now I wish to give onThisTable a different value depending what the user pass over (panel or a pbox or a button) but I cant find what is the correct way to compare what type it is …
Private Sub skill_mouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.MouseHover, button2.MouseHover, panel1.MouseHover, panel2.MouseHover, pbox1.MouseHover
if sender is ( a button )
onThisTable = "Admin"
else if sender is ( a panel )
onThisTable = "dbObject"
else
onThisTable ="Name"
end if
descriptionLabel.Text = dbClass.getDescription(sender.Text, onThisTable)
End Sub
You can use the TypeOf keyword as descibed here (link)