C
Christoph Boget
Please forgive my ignorance as I'm still new to developing w/C#
(and in windows in general). So if I use the wrong terms, please
bear with me.
I'm using VS.NET and defining the events have been really simple.
Just double-click on the event and the definition for that event (along
with the method) gets written. I see that the first argument that is
set up is "object sender" while the second argument varies with the
particular event. Now, what I can't quite figure out is what, exactly,
is passed in as the first argument? I've looked at what is stored in
the variable while debugging and it *seems* as if it's the object I,
say, double-clicked on. However, it's not really. For example, if
I double click on my TreeView control, I see that sender is:
{System.Windows.Forms.TreeView}
but when I try to use any TreeView method or access any TreeView
property, I get a build error saying
'object' does not contain a definition for ...'
Ok, fine. I understand why I got that error: object type is not the same
as TreeView type. So I'm wondering what, exactly, is passed as that
object? And how can I make practical use of it?
Thanks for your time and assistance!
Christoph
(and in windows in general). So if I use the wrong terms, please
bear with me.
I'm using VS.NET and defining the events have been really simple.
Just double-click on the event and the definition for that event (along
with the method) gets written. I see that the first argument that is
set up is "object sender" while the second argument varies with the
particular event. Now, what I can't quite figure out is what, exactly,
is passed in as the first argument? I've looked at what is stored in
the variable while debugging and it *seems* as if it's the object I,
say, double-clicked on. However, it's not really. For example, if
I double click on my TreeView control, I see that sender is:
{System.Windows.Forms.TreeView}
but when I try to use any TreeView method or access any TreeView
property, I get a build error saying
'object' does not contain a definition for ...'
Ok, fine. I understand why I got that error: object type is not the same
as TreeView type. So I'm wondering what, exactly, is passed as that
object? And how can I make practical use of it?
Thanks for your time and assistance!
Christoph