all groups > dotnet windows forms designtime > may 2004 >
You're in the

dotnet windows forms designtime

group:

is it possible to prevent control text property autoassignment on creation in the forms designer?



is it possible to prevent control text property autoassignment on creation in the forms designer? Bob
5/6/2004 5:35:16 PM
dotnet windows forms designtime: I have a control whose text property I don't want automatically set on
creation in the forms designer (i.e. "MyUserControl1"), I want this left
blank unless the user specifically puts in a value. Is this possible? I
thought about using a custom serializer, but the only thing I could come up
with would always keep the text property blank.

TIA,
Bob
Re: is it possible to prevent control text property autoassignment on creation in the forms designer? draiko NO[at]SPAM rhenus.de
5/7/2004 1:38:32 AM
Hallo Bob,

look at IComponentChangeServices.ComponentAdded event. You can hook
it in the .Site setter and then your component gets informed that it
is created. Clear the .Text (or set to a different value) in
the event handler (and you can unhook here, since you need
the event no more).

HTH,
Dima.

[quoted text, click to view]
Re: is it possible to prevent control text property autoassignment on creation in the forms designer? Bob
5/7/2004 2:43:39 PM
Neat, thank you!

Bob

[quoted text, click to view]
Re: is it possible to prevent control text property autoassignment on creation in the forms designer? Kent Boogaart
5/8/2004 1:26:33 PM
Hi Bob,

Would you mind posting the relevant portion of your code that achieves this?
I am trying to do a similar thing but am having no luck.

Thanks,
Kent

[quoted text, click to view]

AddThis Social Bookmark Button