# Setting a Minimum Size for a Splitter Panel

## Content

In some instances, you might want to keep users from resizing a panel past a certain point. In **Panel1**, for example, you may have a stack of buttons that you want visible at all times. When confronted with that sort of situation, you can use the [MinWidth](/componentone/docs/win/online-splitcontainer/) property to specify, in pixels, the size of the area that you don't want users to drag past. In this topic, you will learn how to set the MinWidth property in Design view and in Code view.

For more information on panel sizing, see [SplitterPanel and Splitter Bar Sizing](/componentone/docs/win/online-splitcontainer/splitterpanelbehavio/splitterpanelandspli).

### In Design View:

Complete the following steps:

1. Add [C1SplitContainer](/componentone/docs/win/online-splitcontainer/) to the form.
2. Click on the C1SplitContainer’s smart tag to open its tasks menu.
3. Select **Add Panel** to add a panel to the **C1SplitContainer** control.
4. Click inside **Panel 1** and open its tasks menu. The C1SplitterPanel Tasks menu appears.
5. Right-click inside **Panel 1**and select **Properties**. In the Properties window, set the MinWidth property for **Panel 1** to "30".

### In Code View:

Complete the following steps:

1. Declare the following namespace into your project:
<br>
    ```vbnet
    Imports C1.Win.C1SplitContainer
    ```

    ```csharp
    usingC1.Win.C1SplitContainer;
    ```
2. Add the following code, which sets the MinWidth property, to the **Page\_Load** event:
<br>
    ```vbnet
    Panel1.MinSize = 30
    ```

    ```csharp
    Panel1.MinSize = 30;
    ```
3. Run the program.


![](https://cdn.mescius.io/document-site-files/images/91a148ff-850c-4b63-a7b5-d269cf16bcf7/imagesext/image9_0.png)This Topic Illustrates the Following:

Once you've built the project, drag the splitter bar to the left and observe that it remains at 30 pixels.

## See Also

[Setting a Collapsible Splitter Panel](/componentone/docs/win/online-splitcontainer/splitcontainerforwin3/settingc1splitcontai/settingacollapsibles)