The resizablecontrolextender control is used to scale a web control.
Here is an example:
1) Create an ASP. NET Ajax-enabled web project in vs2005 and name it resizablecontrolextender1.
2) drag and drop a panel on the page and name it panel1. Drag and Drop a resizablecontrolextender under Panel1 and associate it with panel1.
CodeAs follows: 1 < ASP: Panel ID = "Panel1" Runat = "Server" Height = "100px" Width = "100px" Bordercolor = "Navajowhite" Borderstyle = "Solid" Borderwidth = "1px" >
2 Fjffoeijfioejfie < BR />
3 Joefjio < BR />
4 Efjoefjiojfiojfe < BR />
5 </ ASP: Panel >
6 < BR />
7 & Nbsp; </ Div >
8 < C0: resizablecontrolextender ID = "Resizablecontrolextender1" Runat = "Server" Maximumheight = "500"
9 Maximumwidth = "500" Minimumheight = "100" Minimumwidth = "100" Targetcontrolid = "Panel1" Handlecssclass = "Handletext" Resizablecssclass = "Resizingtext" Onclientresize = "Onclientresizetext" > </ C0: resizablecontrolextender >
10
3) Add the onclientresizetext script content on the page.
The Code is as follows: 1 VaR Fontsize = 12 ;
2 Function Onclientresizetext (sender, eventargs)
3 {
4 VaR E = Sender. get_element ();
5 While (E. scrollwidth <= E. clientwidth) | (E. scrollheight <= E. clientheight ))
6 {
7E. style. fontsize=(Fontsize++)+'Pt ';
8}
9 VaR Lastscrollwidth =- 1 ;
10 VaR Lastscrollheight =- 1 ;
11 While (E. clientwidth < E. scrollwidth | E. clientheight < E. scrollheight) && (E. scrollheight ! = Lastscrollwidth | E. scrollwidth ! = Lastscrollheight ))
12 {
13 Lastscrollwidth = E. scrollwidth;
14 Lastscrollheight = E. scrollheight;
15 E. style. fontsize = (Fontsize -- ) + 'Pt ';
16 }
17 }
4) press Ctrl + F5 to view the effect in the browser.
As follows: