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

Sender

P: n/a
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
Share this Question
Share on Google+
8 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
> 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

P: n/a
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

P: n/a
Cor
LOL
I'm SO sorry !

KS, Denmark

Nov 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.