Resizing a web control

  • Thread starter Thread starter One Machete
  • Start date Start date
O

One Machete

Hi,
I have developed a composite control that needs to support resizing in
designer. My research turned up no guidance on the best approach for
this, and I've found no mention of any design-time events fired upon a
control resize or layout change.

SO, my current thought is to put recalculation of the sizes and
positions of the child controls in the OnPreRender override. Anyone
know of any risks I haven't considered or of a better approach?

Of possible relevance: The composite control inherits from and
System.Web.UI.WebControls.Panel and I am using the ms_positioning
attribute to achieve grid layout.

Thanks in advance,
Rich
 
you probably should not use grid layout, unless you control the resolution
and font size of the client browsers. quickly switch to large fonts (in
display settings) and view your pages. if you want a working resize, then
you should do it in client script.

-- bruce (sqlwork.com)
 
Bruce,

Thanks for your reply. The controls will be used in intranet
applications and I am using CSS to control the appearance and some of
the client-side behavior of the controls.

The control won't be resizable at all during run-time, only during
design-time by application developers.

From what I can see, design-time appears to be identical to run-time
with regard control rendering with the exception that you can create a
designer to handle the rendering chores for you at design-time (but that
is only of value to closely mimic the appearance of your control at
run-time).

I've plumbed the newsgroups and seen many threads by individuals asking
this or a related question, but not many replies, so I'm thinking what
I've concluded is pretty much the only approach there is.

Eh, which is fine, I'm a big boy. But I'm disappointed that the support
for composite controls in general seems less than thought out. To be
fair, I should mention I'm using the 1.1 framework. Who knows what
wonders the 2.0 framework would bestow upon me.


======================
 
Back
Top