Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question
Basic VB.NET Syntax Question Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Go Back  Xtreme Visual Basic Talk > > > Basic VB.NET Syntax Question


Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2004, 02:57 PM
KintyHill KintyHill is offline
Newcomer
 
Join Date: Mar 2004
Posts: 1
Default Basic VB.NET Syntax Question


In the code of most objects, when the prodcedure first begins, it contains the following:

Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

Can someone give a simple explanation as to what the "ByVal sender" line and the "ByVal e" line mean?
Reply With Quote
  #2  
Old 03-11-2004, 04:52 PM
Optikal's Avatar
OptikalBasic VB.NET Syntax Question Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

sender is the object that generated the event, e is any parameters that may get sent to the event (eg. a mousedown event usually receives the co-ordinates where the mouse down occurred).
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #3  
Old 03-11-2004, 04:56 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Quote:
Originally Posted by Optikal
sender is the object that generated the event, e is any parameters that may get sent to the event (eg. a mousedown event usually receives the co-ordinates where the mouse down occurred).
How can u use sender.GetType? I was trying to think of a case where u might use it.
Reply With Quote
  #4  
Old 03-11-2004, 04:59 PM
Optikal's Avatar
OptikalBasic VB.NET Syntax Question Optikal is offline
Codeaholic

Retired Leader
* Guru *
 
Join Date: Oct 2002
Location: Winnipeg, MB, Canada
Posts: 4,543
Default

If you had the same method handling the click event for multiple controls (which is possible but usually a bad design), you could call GetType to determine what type of control generated this particular event.
__________________
There are 10 types of people in this world, those that understand binary, and those that don't.
Reply With Quote
  #5  
Old 03-11-2004, 05:02 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

Quote:
Originally Posted by Optikal
If you had the same method handling the click event for multiple controls (which is possible but usually a bad design), you could call GetType to determine what type of control generated this particular event.
Of course. I am still trying to wrap my head around how u can use all different handles!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about Visual Basic KevinJPW Tech Discussions 9 06-09-2003 08:10 PM
Basic User Form Question bds1997 General 2 05-19-2003 09:44 AM
simple syntax question Brian1 General 4 02-05-2003 03:13 PM
Open file syntax question Lar_19 API 3 09-19-2002 06:41 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
 
Basic VB.NET Syntax Question
Basic VB.NET Syntax Question
 
-->