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

Resizing the Control

You can easily change the height and width on the C1Slider by setting the Height and Width properties. By default the height of the control is set to 30px and the width of the control is set to 200px. You can easily change the control's height and width in Design view, Source view, from the Properties window, or in code. Note that setting the Width property also sets the Length property to the same value.

In Design View

To resize the C1Slider 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 300 pixels wide and 50 pixels tall:

 

In Source View

In Source view add Height="50px" Width="300px" (or substitute values you choose) in the <cc1:C1Slider> tag so that it looks similar to the following:

<cc1:C1Slider ID="C1Slider1" runat="server" AutoPostBack="True" Height="50px" Width="300px" />

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

In 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 C1Slider 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, enter the size you want the control's height to be, for example "50px".

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

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

In Code

Add the following code to the Page_Load event to set the Height to 50 pixels and the Width to 300 pixels:

      Visual Basic

Me.C1Slider1.Height = 50

Me.C1Slider1.Width = 300

      C#

this.C1Slider1.Height = 50;

this.C1Slider1.Width = 300;


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