locked
ISupportInitialize- Rebuilding Designer.cs RRS feed

  • Question

  • A while back I created a user control, and then I used it all over the place in my form.

    Now I have modified the control to now use the ISupportInitialize interface.

    But the Designer is not updating itself and adding the BeginInit and EndInit calls to Designer.cs.

    Is there a way to force the Designer to recheck/rebuild itself so that it recognizes the User Control now supports ISupportInitialize and then adds the missing code.

    The opposite occurs when removing ISupportInitialize form a User Control that previously supported it.  The BeginInit and EndInit calls do not get removed from Designer.cs 

    Friday, December 15, 2006 9:58 PM

Answers

  • I didn't find a command or option or anything to do what I wanted but I did find out that dropping another of the same type of control onto the form (after adding/removing ISupportInitialize) causes the Designer to refresh the code for all controls of the same type.

    This solved my Problem although it was a roundabout and unintuitive solution.
    If there is a better way to do this let me know.

    Friday, December 15, 2006 10:17 PM

All replies

  • I didn't find a command or option or anything to do what I wanted but I did find out that dropping another of the same type of control onto the form (after adding/removing ISupportInitialize) causes the Designer to refresh the code for all controls of the same type.

    This solved my Problem although it was a roundabout and unintuitive solution.
    If there is a better way to do this let me know.

    Friday, December 15, 2006 10:17 PM
  • you dont have to add another control (of any type) *designer .cs file updates itself even after minor change like change in size, location etc (any change that is recorded in designer.cs file) but it is still a hassel. and i am still looking for code or technique that will cause designer.cs to update itself and redraw form on changes being made.

     

    Monday, August 4, 2008 10:07 AM