473,462 Members | 1,128 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Sender

Hi,

I can't remember how to get the sending controls name; used it before but
can't find which of my programs has it:-

sender.GetType.GetProperty(????????????????

Please help.

Thanks,
Merlin.
Nov 20 '05 #1
8 1670
This will only work if the sender is a control:

CType(sender, Control).Name

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Merlin" <iM*****@hotmail.com> wrote in message
news:bu**********@hercules.btinternet.com...
Hi,

I can't remember how to get the sending controls name; used it before but
can't find which of my programs has it:-

sender.GetType.GetProperty(????????????????

Please help.

Thanks,
Merlin.

Nov 20 '05 #2
KS
Or just

Sender.Name

KS, Denmark

"Jan Tielens" <ja*@no.spam.please.leadit.be> skrev i en meddelelse
news:%2****************@tk2msftngp13.phx.gbl...
This will only work if the sender is a control:

CType(sender, Control).Name

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Merlin" <iM*****@hotmail.com> wrote in message
news:bu**********@hercules.btinternet.com...
Hi,

I can't remember how to get the sending controls name; used it before but can't find which of my programs has it:-

sender.GetType.GetProperty(????????????????

Please help.

Thanks,
Merlin.


Nov 20 '05 #3
Cor
Hi KS,

I say it for Jan, to show he is not only saying it.

If you are making slow programs
Sender.Name


Otherwise
CType(sender, Control).Name

or
Directcast(sender,Control).name

I hope this helps,

Cor
Nov 20 '05 #4
I agree with Cor, I recommend always to work type safe, so do your own
explicit castings.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Cor" <no*@non.com> wrote in message
news:#5**************@TK2MSFTNGP12.phx.gbl...
Hi KS,

I say it for Jan, to show he is not only saying it.

If you are making slow programs
Sender.Name


Otherwise
CType(sender, Control).Name

or
Directcast(sender,Control).name

I hope this helps,

Cor

Nov 20 '05 #5
Thanks Jan, yes the sender is a control.
I have just worked out that from the procedure I can user sender.name also.

Merlin

"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
This will only work if the sender is a control:

CType(sender, Control).Name

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Merlin" <iM*****@hotmail.com> wrote in message
news:bu**********@hercules.btinternet.com...
Hi,

I can't remember how to get the sending controls name; used it before but can't find which of my programs has it:-

sender.GetType.GetProperty(????????????????

Please help.

Thanks,
Merlin.


Nov 20 '05 #6
> I agree with Cor, I recommend always to work type safe, so do your own
explicit castings.
I agree too. Use "Option Strict On" all the time - you'll be surprised how
many run time errors it can cut out, not to mention making you more aware of
what you're doing.

Trev.
"Jan Tielens" <ja*@no.spam.please.leadit.be> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl... I agree with Cor, I recommend always to work type safe, so do your own
explicit castings.

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Cor" <no*@non.com> wrote in message
news:#5**************@TK2MSFTNGP12.phx.gbl...
Hi KS,

I say it for Jan, to show he is not only saying it.

If you are making slow programs
Sender.Name


Otherwise
> CType(sender, Control).Name

or
Directcast(sender,Control).name

I hope this helps,

Cor


Nov 20 '05 #7
KS
YES, YES, YES I agree - always correct typing !

I'm SO sorry !

KS, Denmark

"KS" <ke************@os.dk> skrev i en meddelelse
news:eR*************@tk2msftngp13.phx.gbl...
Or just

Sender.Name

KS, Denmark

"Jan Tielens" <ja*@no.spam.please.leadit.be> skrev i en meddelelse
news:%2****************@tk2msftngp13.phx.gbl...
This will only work if the sender is a control:

CType(sender, Control).Name

--
Greetz

Jan Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
"Merlin" <iM*****@hotmail.com> wrote in message
news:bu**********@hercules.btinternet.com...
Hi,

I can't remember how to get the sending controls name; used it before but can't find which of my programs has it:-

sender.GetType.GetProperty(????????????????

Please help.

Thanks,
Merlin.



Nov 20 '05 #8
Cor
LOL
I'm SO sorry !

KS, Denmark

Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Merijn Boom | last post by:
Hi there, I'm trying to create an html mail with embedded pictures in it. I run perl on Windows and Red Hat but I cannot get your module (Mail::Sender) to work. I'm just trying to run the...
3
by: Marty | last post by:
Hi, I have this event that is performed by three different controls, how can I know (from sender object) wich control is used to trigger the event? Private Sub HighlightSelectedRow(ByVal...
2
by: KevJB | last post by:
I must say I'm new to these Raw sockets in C# and unfortunantly I haven't met anyone who is a expert in them which makes trying to develop any rather difficult. What I've been doing is trying to...
7
by: Amil | last post by:
based on the following code generated by the IDE: private void toolStripButton1_Click(object sender, EventArgs e) {} How do I convert sender to a ToolStripButton object so I can access its...
1
by: Mike P | last post by:
When I raise an event in my ASP.NET (such as OnServerValidate), how do I get details on the Sender in the called procedure e.g. public void Check_Log_Details(object sender,...
1
by: Ryan McLean | last post by:
Hi everyone! What is happening is the method: sub_btnSubmitClicked is being executed every time any other object with a Handler is executed. I am trying not to use the withevents and handles...
2
by: Roy | last post by:
Ok, this is incredibly annoying. Below I have an ImageButton and it's ImageButton_Click sub. See the 6 response.writes? The output for them is displayed below in asterisks. Question: What part of...
18
by: Euphor2 | last post by:
I'm in school, taking a VB .NET 2003 course, and the teacher taught us how to use Sender.Focus() to return focus to the control from which focus was received. However, when I got home, and tried...
2
by: nomenklatura | last post by:
Hi, i call Call treeviewXi_DoubleClick("Try", e) from another procedur.. and in treeviewX_DoubleClick i use this string and do what i want example : if sender="try" then doit
5
by: raylopez99 | last post by:
I have a form, Form6, that has a bunch of buttons overlaid on it. I want to be able to click on any arbitrary area of the form, and if that area of the form is overlaid by a button, I want to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
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 ...

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.