Web Wiz

  New Posts New Posts RSS Feed - What do these mean, please?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

What do these mean, please?

 Post Reply Post Reply
Author
Blueie View Drop Down
Newbie
Newbie


Joined: 18 March 2012
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Blueie Quote  Post ReplyReply Direct Link To This Post Topic: What do these mean, please?
    Posted: 23 June 2014 at 3:56am
Hello

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?

Thanks!

Blueie
Back to Top
Smurfette View Drop Down
Newbie
Newbie
Avatar

Joined: 21 July 2015
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smurfette Quote  Post ReplyReply Direct Link To This Post 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: https://msdn.microsoft.com/en-us/library/ddck1z30.aspx. 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: https://msdn.microsoft.com/en-us/library/system.eventargs(v=vs.110).aspx
 
I know this is an old thread, so you probably know this by now Tongue
 
 
Back to Top
Blueie View Drop Down
Newbie
Newbie


Joined: 18 March 2012
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Blueie Quote  Post ReplyReply Direct Link To This Post 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.
 
Blueie
 
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.



Become a Fan on Facebook Follow us on Twitter Find us on Google+ Community Forums Web Wiz Blogs Web Wiz News
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Policy

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT unless otherwise stated. VAT No. 988999105 - $, € prices shown as a guideline only.


Copyright ©2001-2017 Web Wiz Ltd. All rights reserved.