Professional Web Applications Themes

"ByVal sender As Object" hmmm, I've so much to learn.... - ASP.NET General

I'll avoid tell you how lame I am and get straight to the question... I need a good expanation to the "ByVal sender As Object, ByVal e As System.EventArgs" part of; Public Sub button01_click(ByVal sender As Object, ByVal e As System.EventArgs) I dont understand any of that part. ByVal? sender? e? System.EventArgs? Do you know of any good references explaining what this stuff is? I'm sure it's different for each routine, and I obviously need to learn... cheers and thanks m...

  1. #1

    Default "ByVal sender As Object" hmmm, I've so much to learn....

    I'll avoid tell you how lame I am and get straight to the question...

    I need a good expanation to the "ByVal sender As Object, ByVal e As
    System.EventArgs" part of;
    Public Sub button01_click(ByVal sender As Object, ByVal e As
    System.EventArgs)

    I dont understand any of that part. ByVal? sender? e?
    System.EventArgs? Do you know of any good references explaining what
    this stuff is? I'm sure it's different for each routine, and I
    obviously need to learn...

    cheers and thanks

    m
    Maurice Guest

  2. #2

    Default Re: "ByVal sender As Object" hmmm, I've so much to learn....

    First, ByVal and ByRef mean "by value" and "by reference". Since everything
    you do on a computer is in memory, something things just want a "pointer" to
    the memory location where you data is. Some want the actual data itself.
    There are advantages to both.

    A ByVal parameter makes a copy of the value, whereas ByRef passes the
    pointer to the memory address. Therefore, if a parameter is passed ByRef and
    you change it's value in your function, it changes for the caller too -
    because you were both pointing at the same memory location.

    If a parameter is passed in ByVal, then you have a copy of it. If you make
    changes inside your function, then it leaves the orginal alone - because you
    have a seperate copy.

    "sender" is a generic reference to which object kicked off the event that
    you are in. You may just want to know, who fired the event. "EventArgs" are
    arguments that go along with that event. Those both become more meaningful
    when you use an object like a treeview - where the sender is the node that
    was clicked, etc..

    hth

    "Maurice Walmsley" <com> wrote in message
    news:google.com... 


    Frank Guest

  3. #3

    Default Re: "ByVal sender As Object" hmmm, I've so much to learn....

    Is Object always passed by reference?

    "Frank Drebin" <com> wrote in message
    news:QeU0b.28205$news.prodigy.com... 
    everything 
    to 
    and 
    you 
    are 
    >
    >[/ref]


    JohnG Guest

  4. #4

    Default Re: "ByVal sender As Object" hmmm, I've so much to learn....

    Say what!

    "Kevin Spencer" <com> wrote in message
    news:emCCMI%phx.gbl... 
    >
    > Yes, but there are still times when you may need to pass an Object ByRef.
    > For example, if you need to re-assign the Object, you have to pass it[/ref]
    ByRef. 
    > > everything [/ref]
    > "pointer" [/ref][/ref]
    itself. [/ref][/ref]
    ByRef [/ref][/ref]
    too - [/ref]
    > make [/ref][/ref]
    because [/ref]
    > that [/ref][/ref]
    "EventArgs" [/ref]
    > meaningful [/ref]
    > that [/ref][/ref]
    question... 
    > >
    > >[/ref]
    >
    >[/ref]


    MS Guest

Similar Threads

  1. Replies: 3
    Last Post: July 9th, 04:01 AM
  2. Can't locate object method "blocking" via package "IO::Handle"
    By kemton@kemton.com in forum PERL Modules
    Replies: 1
    Last Post: June 20th, 02:54 PM
  3. Replies: 2
    Last Post: April 15th, 01:41 PM
  4. Replies: 2
    Last Post: August 2nd, 10:53 PM
  5. Replies: 2
    Last Post: July 18th, 01:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139