ComponentOne Expander for ASP.NET AJAX: Expander for ASP.NET AJAX Task-Based Help > Resizing the Control

Resizing the Control

You can easily change the height and width on the C1Expander by setting the Height and Width properties. By default the height of the control is set to 200px and the width of the control is set to 100px. You can easily change the control's height and width in Design view, Source view, from the C1Expander Tasks menu, from the Properties window, or in code. See the Setting the Height and Width at Run Time topic for resizing the control on the client side.

In Design View

To resize the C1Expander control in Design view, click the bottom-right corner of the control and perform a drag-and-drop operation to set the control's size.

For example, in the following image the control has been resized to 150 pixels wide and 150 pixels tall:

In Source View

In Source view change Height="200px" Width="100px" in the <cc1:C1Expander> tag to the size you wish to set the control's height and width to, for example:

<cc1:C1Expander ID="C1Expander1" runat="server" HeaderSize="25px" Height="150px" Width="150px">

The above will resize the control to 150 pixels tall and 150 pixels wide.

From the Tasks Menu

You can set the control's height and width from the C1Expander Tasks menu:

1.   Click on the C1Expander's smart tag to open the C1Expander Tasks menu.

2.   In the Width text box, replace "100px" with the size you want the control's width to be, for example "150px".

3.   In the Height text box, replace "200px" with the size you want the control's height to be, for example "150px".

4.   Click outside of the C1Expander Tasks menu to close the menu and set the width and height of the control.

From the Properties Window

You can change the Height and Width properties to set the control's height and width in the Properties window:

1.   Click on the C1Expander to select it.

2.   Navigate to the Properties window and if needed expand the Layout node to locate the Height and Width properties.

3.   Next to Height, replace "200px" with the size you want the control's height to be, for example "150px".

4.   Next to Width, replace "100px" with the size you want the control's width to be, for example "150px".

5.   Press the ENTER key or click outside of the Properties window for the height and width you set to be applied to the C1Expander control.

In Code

Add the following code to the Page_Load event to set the Height and Width properties to 150 pixels:

      Visual Basic

Me.C1Expander1.Height = 150

Me.C1Expander1.Width = 150

      C#

this.C1Expander1.Height = 150;

this.C1Expander1.Width = 150;


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.