473,474 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Refer object itself

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
2 1607
* =?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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Ian Tompsett | last post by:
H I was wondering if it possible for an object to serialize/deserialize itself from XML. I'd be guessing that it would need to use the XmlSerializer class, but that seems to want to create a...
7
by: Ivo | last post by:
How do I make the magic 'this' variable refer to an object of my choice, in a string of code which is to be eval'ed? Say, I have an object, an array with four elements: var myobject = ; and a...
8
by: Sullivan WxPyQtKinter | last post by:
When debugging using 'print' statement, I usually want to print some important values together with the function name as the context of the values printed out. So my hope is that I could get the...
4
by: Russell | last post by:
This is more a Python 2.5 question, since it is the send() method that makes this so useful. The issue is how to write a generator that refers to its own generator object. This would be useful...
7
by: Arpan | last post by:
The .NET Framework 2.0 documentation states that An Object variable always holds a pointer to the data, never the data itself. Now w.r.t. the following ASP.NET code snippet, can someone please...
1
by: Kai Zhu | last post by:
I've write a script like this. <script> function A() { this.onMouseDown = function(event) { ..... } } var objA = new A(); htmlelement.onmousedown = a.onmousedown; </script>
4
by: john | last post by:
I have a bound textfield in my form. In the beforeupdate event of that field I want to refer to that field's value. What's the easiest way to refer to that field's value? st = MyFieldName works...
8
by: Andy B | last post by:
Is there a way to refer to things in Session object without calling Session itself?
3
by: yosibeck | last post by:
sorry folks, I'm sure this is a newbie question. On my website I have one DIV (id="menu") with position:fixed that serves as a fixed menu bar. Then comes the second DIV (id="content") that holds...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.