ControlDesigner does not "repaint" control when properties are changed

V

Vincent Scheel

Hello everyone,

I've build a CompositeControl (a photogallery) which has a few
properties (number of rows, number of columns). The control has a
designer which extends the ControlDesigner class. Everything goes well,
but when I change the properties designtime, the control doesn't change
right away. When i switch to source and back to designview the control
does change and uses the new properties.

When I debug the control, I can tell the CreateChildControls method
doesn't fire again, and so the changes can't be noticed. As a test I
solved it by adding a SetChildControlsCreatedFalse() method to the
control (which set the ChildControlsCreated to false) and I called this
method from the ComponentChanged() method of the designer. That works,
but is not a nice way of doing it. Is there a nice way of doing that? I
heard something about using the IControlDesignerAccessor interface, but
i'm not sure how to do that. I also tried implementing the
ICompositeControlDesignerAccessor.RecreateChildControls() method, but
it doens't fire at all.

I hope someone can help me out,

Kind regards

Vincent Scheel
The Netherlands
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top