Updating custom control is not reflected in the project

  • Thread starter Thread starter Pug Fugly
  • Start date Start date
P

Pug Fugly

I have created a simple windows custom cotrol that inherits a button.
I have it added to the toolbox and I am able to add it to my form
successfully. The problem comes when I decide to change a property on
my custom control (like the background color). The change is not
reflected across my project. If I select and delete the button from
my form, then add it again the changes will be shown. But I want to
be able to have the change automatically propagated everywhere the
button control is referenced. It seems like this should be possible.
I have tried deleting and re-adding the control to the toolbox, but
that didn't help. What am I doing wrong? Is what I am asking for
even possible?

Thanks in advance.
 
I have created a simple windows custom cotrol that inherits a button.
I have it added to the toolbox and I am able to add it to my form
successfully. The problem comes when I decide to change a property on
my custom control (like the background color). The change is not
reflected across my project. If I select and delete the button from
my form, then add it again the changes will be shown. But I want to
be able to have the change automatically propagated everywhere the
button control is referenced. It seems like this should be possible.
I have tried deleting and re-adding the control to the toolbox, but
that didn't help. What am I doing wrong? Is what I am asking for
even possible?

Thanks in advance.

I'm not sure if I fully understand what you are trying to accomplish -
but generally, if you make a change to a custom control, you have to
recompile it for the change to be reflected. Is the button control in
the same solution? Am I even close to understanding your problem? :)
 
Sorry if i was unclear. Yes the control is in the same solution.
However, I have 2 projects under that solution. One is a windows app
(the form), and one is a class library (the custom control). So once
i set up the control and place it on my form, everything is fine. Now
when I go to my class library and change my custom control, the
already added control (button in this case) does not change according
to the code change I made in the custom control. I was testing with
simple changes like changing the background color property on the
button. Of course, I build the class library first before checking.
I have tried re-adding it to the toolbox, and removing and adding the
reference to the class library, but nothing worked. If I was to add
another instance of the custom control to my form this new instance
would have the changed background but the one previously added would
not. It seems to be referencing the old DLL somehow. How do I fix
this?
 
Never mind... I found the problem. In case anyone out there is
having the same problem, make sure you are referencing the class
library DLL from the obj/debug folder (not bin) when you add your
custom control to the toolbox.
 
Back
Top