Programmatically resizing a web custom control at design time

N

~~~ .NET Ed ~~~

I have written a simple web custom control. The control however also acts as
some place holder (could be a banner, picture or whatever). The control also
has a set of properties to set the width and height.

Then when either the width or height is set (using the property) the
control's Width and Height properties (from the base class CustomControl) is
updated:

private void AdjustSize(int w, int h)
{
this.Width = new Unit(w, UnitType.Pixel);
this.Height = new Unit(h, UnitType.Pixel);
}


The custom we control also has its design time class. Everything is fine
except for the annoying fact that if in the design surface (VS) I change the
size property (which is a single property containing width and height and
invokes
the AdjustSize method) the design-time place holder does not get resized, it
simply stays (visually) in its default size.

Do note that internally the control's dimensions have been updated (in
design time it displays the WxH string).

So, I think there is something else I must do other than setting this.Width
and this.Height in order to get the design time "visual" to also display in
the selected dimensions. Any ideas?
 
N

~~~ .NET Ed ~~~

There appears to be no way to do this (I am shocked). So far searches on the
net for articles and resources have turned out nothing.
 

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,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top