By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,326 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,326 IT Pros & Developers. It's quick & easy.

Refer object itself

P: n/a
Dear all,

I know that "me" can be used to refer current active form. How can I refer
an object (e.g. a button) within it's own event code without using the object
name (something just like "this" in VFP)?

Thanks a lot.

Nov 21 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* =?Utf-8?B?UHJvUm9kbWFu?= <Pr*******@discussions.microsoft.com> scripsit:
I know that "me" can be used to refer current active form. How can I refer
an object (e.g. a button) within it's own event code without using the object
name (something just like "this" in VFP)?


\\\
Dim SourceControl = DirectCast(sender, Button)
....
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #2

P: n/a
Keep in mind that a button doesn't actually own its event code, its owned by
the form. That distinction may not matter to you now, but eventually you'll
come across a case where it does.

--
Jonathan Allen
"ProRodman" <Pr*******@discussions.microsoft.com> wrote in message
news:8E**********************************@microsof t.com...
Dear all,

I know that "me" can be used to refer current active form. How can I refer
an object (e.g. a button) within it's own event code without using the object name (something just like "this" in VFP)?

Thanks a lot.

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.