ComponentOne Splitter for ASP.NET AJAX: Splitter for ASP.NET AJAX Task-Based Help > Changing the Appearance of a C1Splitter Control > Changing Splitter Bar Location

Changing Splitter Bar Location

The default location of the splitter bar is 100 pixels from the left for a vertical split and 100 pixels from the top for a horizontal split. You can adjust the initial location of the splitter bar using the SplitterDistance property. In this topic, you will learn how to set the SplitterDistance property in Design view, in Source view, and in code.

In Design View

Complete the following steps:

1.   Add C1Splitter to the Web form.

2.   Right-click on the control and select Properties.

3.   In the Properties window, locate the SplitterDistance property and specify a number to represent the location of the splitter bar from the left edge of the splitter bar. For this example, we'll set it to "50".

4.   Run the program.

In Source View

To set the splitter bar location, place SplitterDistance="50" within the <cc1:C1Splitter> tag. Once the SplitterDistance property has been set, the markup will resemble the following:

 

<cc1:C1Splitter ID="C1Splitter1" runat="server" Height="251px" Width="217px" SplitterDistance="50">

In Code

Complete the following steps:

1.   Import the following namespace into your project:

      Visual Basic

Imports C1.Web.UI.Controls.C1Splitter

      C#

using C1.Web.UI.Controls.C1Splitter;

2.   Add the following code to the Page_Load event to set the SplitterDistance property:

      Visual Basic

C1Splitter1.SplitterDistance = 50

      C#

C1Splitter1.SplitterDistance = 50;

3.   Run the program.

Description: D:\Whidbey\T109\C1Splitter\WordDocuments\Other Graphics\10.png This Topic Illustrates the Following:

The following image depicts a C1Splitter with a splitter set 50 pixels from the left side of the control:

 

Description: SplitterDistance_Final


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