Print Page | Close Window

What do these mean, please?

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
Printed Date: 03 June 2020 at 4:28am
Software Version: Web Wiz Forums 12.03 -

Topic: What do these mean, please?
Posted By: Blueie
Subject: What do these mean, please?
Date Posted: 23 June 2014 at 3:56am

In an expression such as this: 

Protected Sub CreateUser_Click(ByVal sender As Object, ByVal e As System.EventArgs), what do these actually mean, or represent, please:

ByVal sender As Object, ByVal e As System.EventArgs

and that little 'e'?

Can (ByVal sender As Object, ByVal e As System.EventArgs), be broken up into:

1) ByVal sender As Object
2) ByVal e As System.EventArgs

I am trying to understand what these mean to a Windows computer in the .NET environment. In human-speak, what are they telling the computer to do?



Posted By: Smurfette
Date Posted: 21 July 2015 at 10:59am
In VB, you can pass arguments by value or by reference (ByVal or ByRef).
There's a pretty good explanation of the difference here: Basically, ByVal prevents those variables from being changed by the procedure you are calling. The structure of this procedure indicates that it is a Webforms project and that this automatically-generated sub is called on the click event of a button called "CreateUser". It contains two arguments.
Byval sender as Object is the first argument. "Sender" is the object (in this case, the button) that raised the click event.
ByVal e as System.EventArgs is the second argument, where "e" is the event data. This gives an overview of the structure of the EventArgs class:
I know this is an old thread, so you probably know this by now Tongue

Posted By: Blueie
Date Posted: 21 July 2015 at 6:21pm
Hello Smurfette
Many thanks for your reply and explanation.
I will take a look at those links you have kindly provided.
No, I didn't know it. You are the first one to explain!
Thanks again.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 -
Copyright ©2001-2019 Web Wiz Ltd. -