Chart for .NET / User's Guide / Layout / Content Panels / BackgroundFillStyle and BorderStyle

In This Topic
BackgroundFillStyle and BorderStyle
In This Topic

Each content panel has two properties called BorderStyle and BackgroundFillStyle that allow you to set a border and fill style applied on the panel background. By default both are set to null indicating that the panel does not have a background and border. The following picture shows a numeric display panel with applied round border and black background:

In order to change the border style you need to create an instance of one of the following types:

Border Type Description
NStrokeBorderStyle Applies single outline (stroke) to the panel
NEdgeBorderStyle  Applies a border style consisting of three stripes with controllable filling and width to the panel

The following code shows how to apply a border and background fill style to a panel:

C#
Copy Code
NNumericDisplayPanel numericDisplay = new NNumericDisplayPanel();
numericDisplay.BorderStyle = new NEdgeBorderStyle();
numericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.LightGray);
numericDisplay.Value = 123456.789;
nChartControl1.Panels.Add(numericDisplay);
Visual Basic
Copy Code
NNumericDisplayPanel numericDisplay = new NNumericDisplayPanel();
numericDisplay.BorderStyle = new NEdgeBorderStyle();
numericDisplay.BackgroundFillStyle = new NColorFillStyle(Color.LightGray);
numericDisplay.Value = 123456.789;
nChartControl1.Panels.Add(numericDisplay);
 Related Examples

Windows Forms: All Examples\Gauge Gallery

Web Forms: All Examples\Gauge Gallery