Re: Just what the h can we do with "sender" - new guy question
- From: bob clegg <cutbob_clegg@xxxxxxxxxxxxxxxxxxx>
- Date: Sun, 04 Nov 2007 08:56:43 +1300
Hi,
In the context you describe the sender is not much use to you.
The problem is that the sender is the context menu.
The data that you want to deal with is in the treeview.
There may be a more elegant way but what I do here is capture
where you are in the treeview with the mousedown event into a global
point say mPosition.
The context menu decides what action to take
And in that code you reference the treeview by using
currentnode=myTreeView.mygetnodeat(mPosition)
hth
Bob
On Fri, 02 Nov 2007 01:50:28 -0000, "T.Davis"
<trevorhughdavis@xxxxxxxxx> wrote:
Okay, when you subscribe to an event, and that event fires, it is.
passed (sender, eventargs), yea?
So what is sender? Can you do anything with it other than toString()?
If it's a reference to the object that fired the event, how can I
access that object's properties?
I'm new, and am trying to get my sea legs. I've got an application
that fills a treeview with tables from a mysql database.
I've added a context menu. I want one of the items to be "load this
table." In order for that to work, I need to get the text of the
treeview node. How do I do this?
treeview
+ blah table <-- context menu from this part, select "Load this
table" Need to get "blah"
- id
- name
- isugly
+ blah_again table
- id
- name
- description
Thanks in advance.
ps.
i find the word "newbie" icky.
- References:
- Prev by Date: Re: String Conversion to Int
- Next by Date: Re: Timer problem
- Previous by thread: Re: Just what the h can we do with "sender" - new guy question
- Next by thread: SqlAdapter, dataset
- Index(es):
Relevant Pages
|