Refer object itself

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
* =?Utf-8?B?UHJvUm9kbWFu?= said:
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)
....
///
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top