2
Answers

How do I refresh designed forms after a controls library is rebuilt?

Photo of prathameshk

prathameshk

20y
2.7k
1
Hi All, I have prepared a library of controls (say MyControls.dll) extended from Windows Form Controls (Button, TextBox, etc). These extended controls are then placed on forms at design time. When I make any changes in the visual properties of my extended controls (BackColor, etc) and rebuild MyControls.dll, I want the controls put on the designed forms to reflect these changes (i.e. if I have already put MyButton1 on a form, then I want it to now show the new BackColor). How do I achieve this? -- I have traced the problem to InitializeComponent() in "Windows Form Designer generated code" -- All attributes set in the InitializeComponent() of MyButton (BackColor, etc) are again set in the InitializeComponent() of the form once a MyButton is placed on it -- When I change the original MyButton (and rebuild MyControls.dll), the attributes for MyButton controls in InitializeComponent() of the form DO NOT change! (Hence the problem) Please help!!! Thanks and Regards Prathu

Answers (2)

0
Photo of prathameshk
NA 5 0 20y
Yes this would work fine. In fact it does. But I have hundreds of controls carefully aligned, attributes set, et all on the forms. And if I remove and add them it would mean doing the whole thing again.
0
Photo of fixme
NA 32 0 20y
Have you tried removing the control and adding it again to the form? This will cause the designer to remove the generated code and replace it. These types of issues are the very reason I don't use the designer.