Back to Devexpress

RoundedSkinPanel Class

windowsforms-devexpress-dot-xtraeditors-4eec54f5.md

latest8.5 KB
Original Source

RoundedSkinPanel Class

A panel that supports rounded corners in the WXI skin.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public class RoundedSkinPanel :
    ContainerControl,
    IDXControl,
    ISupportLookAndFeel,
    IHookController,
    ISupportInitialize,
    IXtraResizableControl,
    IDirectXProviderOwner,
    IDirectXClientProvider
vb
Public Class RoundedSkinPanel
    Inherits ContainerControl
    Implements IDXControl,
               ISupportLookAndFeel,
               IHookController,
               ISupportInitialize,
               IXtraResizableControl,
               IDirectXProviderOwner,
               IDirectXClientProvider

Remarks

The RoundedSkinPanel displays rounded corners and adds padding around its content when the WXI skin is applied. In other skins, the panel has the standard (rectangular) border without padding around the panel’s content. Use the BorderStyle property to implicitly specify the panel’s border style.

See the following animation to get started:

Warning

The RoundedSkinPanel control is designed to host only one UI control (such as a Data Grid, TreeList, or Spreadsheet). However, it can contain multiple nested RoundedSkinPanel controls, while hosting only a single primary UI control. The following message appears if you add more than one UI control to a RoundedSkinPane at design time:

The following code snippet creates a RoundedSkinPanel control that hosts two RoundedSkinPanel controls:

csharp
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraTreeList;
using System.Windows.Forms;

namespace DXApplication {
    public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm {
        RoundedSkinPanel roundedSkinPanel1, roundedSkinPanel2, roundedSkinPanel3;
        GridControl gridControl1, gridControl2;
        public Form1() {
            InitializeComponent();
            // Create the first GridControl
            GridControl gridControl1 = new GridControl() { Dock = DockStyle.Fill };
            // Assign a GridView to the first GridControl.
            gridControl1.MainView = new GridView();
            // Create the first RoundedSkinPanel and set it to fill the form.
            roundedSkinPanel1 = new RoundedSkinPanel() { Dock = DockStyle.Fill };
            // Add the GridControl to the first panel.
            roundedSkinPanel1.Controls.Add(gridControl1);

            // Create a TreeList.
            TreeList treeList1 = new TreeList() { Dock = DockStyle.Fill };
            // Create the second RoundedSkinPanel, dock it to the left, and set its width.
            roundedSkinPanel2 = new RoundedSkinPanel() { Dock = DockStyle.Left, Width = 300 };
            // Add the TreeList to the second panel.
            roundedSkinPanel2.Controls.Add(treeList1);

            // Create the second GridControl.
            GridControl gridControl2 = new GridControl() { Dock = DockStyle.Fill };
            // Assign a GridView to the second GridControl.
            gridControl2.MainView = new GridView() { BorderStyle = BorderStyles.NoBorder };
            // Create the third RoundedSkinPanel, dock it to the bottom, and set its height.
            roundedSkinPanel3 = new RoundedSkinPanel() { Dock = DockStyle.Bottom, Height = 200 };
            // Add the second GridControl to the third panel.
            roundedSkinPanel3.Controls.Add(gridControl2);

            // Add the bottom panel and the left panel to the first panel.
            roundedSkinPanel1.Controls.Add(roundedSkinPanel3);
            roundedSkinPanel1.Controls.Add(roundedSkinPanel2);

            // Add the first panel (containing all other panels) to the form.
            this.Controls.Add(roundedSkinPanel1);
        }

    }
}
vb
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Controls
Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraTreeList
Imports System.Windows.Forms

Namespace DXApplication
    Public Partial Class Form1
        Inherits DevExpress.XtraBars.Ribbon.RibbonForm

        Private roundedSkinPanel1 As RoundedSkinPanel
        Private roundedSkinPanel2 As RoundedSkinPanel
        Private roundedSkinPanel3 As RoundedSkinPanel
        Private gridControl1 As GridControl
        Private gridControl2 As GridControl

        Public Sub New()
            InitializeComponent()
            ' Create the first GridControl
            gridControl1 = New GridControl() With {.Dock = DockStyle.Fill}
            ' Assign a GridView to the first GridControl.
            gridControl1.MainView = New GridView()
            ' Create the first RoundedSkinPanel and set it to fill the form.
            roundedSkinPanel1 = New RoundedSkinPanel() With {.Dock = DockStyle.Fill}
            ' Add the GridControl to the first panel.
            roundedSkinPanel1.Controls.Add(gridControl1)

            ' Create a TreeList with no border
            Dim treeList1 As New TreeList() With {.Dock = DockStyle.Fill}
            ' Create the second RoundedSkinPanel, dock it to the left, and set its width.
            roundedSkinPanel2 = New RoundedSkinPanel() With {.Dock = DockStyle.Left, .Width = 300}
            ' Add the TreeList to the second panel.
            roundedSkinPanel2.Controls.Add(treeList1)

            ' Create the second GridControl.
            gridControl2 = New GridControl() With {.Dock = DockStyle.Fill}
            ' Assign a GridView to the second GridControl.
            gridControl2.MainView = New GridView()
            ' Create the third RoundedSkinPanel, dock it to the bottom, and set its height.
            roundedSkinPanel3 = New RoundedSkinPanel() With {.Dock = DockStyle.Bottom, .Height = 200}
            ' Add the second GridControl to the third panel.
            roundedSkinPanel3.Controls.Add(gridControl2)

            ' Add the bottom panel and the left panel to the first panel.
            roundedSkinPanel1.Controls.Add(roundedSkinPanel3)
            roundedSkinPanel1.Controls.Add(roundedSkinPanel2)

            ' Add the first panel (containing all other panels) to the form.
            Me.Controls.Add(roundedSkinPanel1)
        End Sub

    End Class
End Namespace

The following screenshot shows the result:

Specific Notes

  • The RoundedSkinPanel does not support a right-to-left (RTL) layout.
  • The RoundedSkinPanel cannot host the MapControl.
  • Use the Layout Control’s RoundedPanelIntegrationMode property to specify whether the Layout Control automatically adapts its padding within a RoundedSkinPanel container.

Implements

IXtraResizableControl

Inheritance

Object MarshalByRefObject Component Control ScrollableControl ContainerControl RoundedSkinPanel

See Also

Windows 11 UI

RoundedSkinPanel Members

DevExpress.XtraEditors Namespace