Discussion:
Capture/Tarp Name Change In User Control?
(too old to reply)
Jeff Gaines
2009-10-19 13:02:24 UTC
Permalink
Is there a way to trap a change of name for a User Control?

I want to set some text based on the name of the control at design time
but I can't see 'OnNameChanged' or anything similar.
--
Jeff Gaines Dorset UK
There is absolutely no substitute for a genuine lack of preparation
John Bundy
2009-10-20 13:51:01 UTC
Permalink
This either makes no sense, or I just don't get it. Unless you build
something to let people change a control name, they can't, built in trap.
Then you say you want to change text based on if it changes at design time,
you are doing the designing, you know when you change the name of the
control. What am i missing?
--
-John http://www.jmbundy.blogspot.com/
Please rate when your question is answered to help us and others know what
is helpful.
Post by Jeff Gaines
Is there a way to trap a change of name for a User Control?
I want to set some text based on the name of the control at design time
but I can't see 'OnNameChanged' or anything similar.
--
Jeff Gaines Dorset UK
There is absolutely no substitute for a genuine lack of preparation
.
Jeff Gaines
2009-10-20 14:28:45 UTC
Permalink
On 20/10/2009 in message
Post by John Bundy
This either makes no sense, or I just don't get it. Unless you build
something to let people change a control name, they can't, built in trap.
Then you say you want to change text based on if it changes at design time,
you are doing the designing, you know when you change the name of the
control. What am i missing?
I have put together a control with a Label on the Left and Text Box on the
right. The intention is to save time when designing Forms with loads of
data on them, say an address book.

What I would like to do is to be able to name the instance of the control
jtxtHomeAddress and then parse that name and automatically extract 'Home
Address' to go in the label portion. It may sound lazy but it would be a
real time saver! The parsing is easy but I want to trap any name change so
I can change the label text automatically.
--
Jeff Gaines Dorset UK
Indecision is the key to flexibility
Jack Jackson
2009-10-20 14:09:11 UTC
Permalink
On Mon, 19 Oct 2009 06:02:24 -0700, "Jeff Gaines"
Post by Jeff Gaines
Is there a way to trap a change of name for a User Control?
I want to set some text based on the name of the control at design time
but I can't see 'OnNameChanged' or anything similar.
I can think of two approaches.

The easiest, which may not work, is to create a Shadow property named
Name. The Get part will return Mybase.Name and the Set part will do
whatever special code you want and then set Mybase.Name.

If that doesn't work, you can hook into the processing of the IDE.
This is vastly more complicated and not very well documented.
Jeff Johnson
2009-10-21 13:37:26 UTC
Permalink
[Canned response]

You have posted this question individually to multiple groups. This is
called Multiposting and it's BAD. Replies made in one group will not be
visible in the other groups, which may cause multiple people to respond to
your question with the same answer because they didn't know someone else had
already done it. This is a waste of time.

If you MUST post your message to multiple groups, post a single message and
select all the groups (or type their names manually, separated by commas) in
which you want it to be seen. This is called Crossposting and when used
properly it is GOOD.

(This isn't just my opinion. Look here:
http://www.oakroadsystems.com/genl/unice.htm#xpost)
Jeff Gaines
2009-10-21 15:05:20 UTC
Permalink
Post by Jeff Johnson
You have posted this question individually to multiple groups. This is
called Multiposting and it's BAD. Replies made in one group will not be
visible in the other groups,
I know and I do feel *BAD* :-)

You've seen my comment in the other group now though.
--
Jeff Gaines Dorset UK
It may be that your sole purpose in life is to serve as a warning to others.
Loading...