Jump to content
Xtreme .Net Talk

What are those parameters for?


Recommended Posts

Posted

Hi,

 

Can you give me a very very simple example that shows what are the parameters (Object, EventArgs) for and what is Handles Button1.Click?

 

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

  • *Gurus*
Posted

Sender is the object that was clicked. Since one sub can handle

the events of many control objects, you have to have some way

to know what control object was clicked. If you are only handling

the event from one control object, you can pretty much ignore it.

e as EventArgs is an object holding arguments that could be

passed from the event. Once again, if there aren't any

arguments, you can just ignore it.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...