Value Indicators Type And Style Example for WinForms

Value Indicators Type And Style Example for WinForms

Nevron NOV Gauge for WinForms ships with hundreds of examples with full source code, as part of the Nevron Open Vision Suite. All WinForms Gauge examples are also available as a stand-alone Visual Studio solution in C# and VB.NET, which you can download from the links below.

Value Indicators Type And Style Example for WinForms Description

The example demonstrates how use the begin and end percent properties of the anchor in order to change the gauge axis size.


Value Indicators Style Example

C# Value Indicators Type And Style Example Code for Nevron Gauge for WinForms
Language: C#

using Nevron.Nov;
using Nevron.Nov.Chart;
using Nevron.Nov.Dom;
using Nevron.Nov.Graphics;
using Nevron.Nov.Layout;
using Nevron.Nov.UI;
using Nevron.Nov.Windows.Forms;
using System;
using System.Windows.Forms;

namespace NovWinFormsProject
{
	public partial class Form1 : Form
	{
		#region Constructors

		public Form1()
		{
			InitializeComponent();

			// Set form title
			Text = "NOV WinForms - NValueIndicatorsStyleExample";

			// Create the NOV example and its controls
			NWidget exampleContent = CreateExampleContent();
			NWidget exampleControls = CreateExampleControls();
			if (exampleControls != null)
			{
				exampleControls.PreferredWidth = 300;
			}

			// Place the example and its controls in a pair box
			NPairBox pairBox = new NPairBox(exampleContent, exampleControls);
			pairBox.FillMode = ENStackFillMode.First;
			pairBox.FitMode = ENStackFitMode.First;
			pairBox.Margins = new NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing);

			// Host the example in the form
			NNovWidgetHost host = new NNovWidgetHost(pairBox);
			host.Dock = DockStyle.Fill;
			Controls.Add(host);
		}

		#endregion

		#region Example

		public NWidget CreateExampleContent()
		{
			NStackPanel stack = new NStackPanel();
			
			NStackPanel controlStack = new NStackPanel();
			stack.Add(controlStack);

			// create the radial gauge
			m_RadialGauge = new NRadialGauge();
			m_RadialGauge.PreferredSize = defaultRadialGaugeSize;
			controlStack.Add(m_RadialGauge);

			m_RadialGauge.Dial = new NDial(ENDialShape.Circle, new NEdgeDialRim());
			m_RadialGauge.Dial.BackgroundFill = new NStockGradientFill(NColor.DarkGray, NColor.Black);

			NGelCapEffect gelEffect = new NGelCapEffect(ENCapEffectShape.Ellipse);
			gelEffect.Margins = new NMargins(0, 0, 0, 0.5);

            m_RadialGauge.Axes.Clear();

            m_RadialGauge.SweepAngle = new NAngle(360, NUnit.Degree);

            // create the first axis
            NGaugeAxis axis1 = new NGaugeAxis();
			axis1.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, 0, 70);
           
            m_RadialGauge.Axes.Add(axis1);

            // Scale 
            NStandardScale scale1 = (NStandardScale)axis1.Scale;
			scale1.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke);
			scale1.MinorTickCount = 3;
			scale1.Ruler.Fill = new NColorFill(NColor.FromColor(NColor.White, 0.4f));
			scale1.OuterMajorTicks.Fill = new NColorFill(NColor.Orange);
			scale1.Labels.Style.TextStyle.Font  = new NFont("Arimo", 12, ENFontStyle.Bold);
			scale1.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White);
			scale1.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0);

			// create the second axis
			NGaugeAxis axis2 = new NGaugeAxis();
			axis2.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, false, 75, 95);
           
            m_RadialGauge.Axes.Add(axis2);
           
            // scale
            NStandardScale scale2 = (NStandardScale)axis2.Scale;
            scale2.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke);
			scale2.MinorTickCount = 3;
			scale2.Ruler.Fill = new NColorFill(NColor.FromColor(NColor.White, 0.4f));
			scale2.OuterMajorTicks.Fill = new NColorFill(NColor.Blue);
			scale2.Labels.Style.TextStyle.Font = new NFont("Arimo", 12, ENFontStyle.Bold);
			scale2.Labels.Style.TextStyle.Fill = new NColorFill(NColor.White);
			scale2.Labels.Style.Angle = new NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0);

			// add range indicators
			NRangeIndicator rangeIndicator = new NRangeIndicator();
            rangeIndicator.OriginMode = ENRangeIndicatorOriginMode.ScaleMax;
            rangeIndicator.Value = 100;
			rangeIndicator.Palette = new NThreeColorPalette(NColor.Green, NColor.Red, NColor.Orange, 50.0);
			rangeIndicator.Stroke.Width = 0;
			rangeIndicator.OffsetFromScale = 3;
			rangeIndicator.BeginWidth = 15;
			rangeIndicator.EndWidth = 25;

			m_RadialGauge.Indicators.Add(rangeIndicator);

			// needle value indicator1
            m_ValueIndicator = new NNeedleValueIndicator();
            m_ValueIndicator.Value = 79;
            m_ValueIndicator.Fill = new NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red);
            m_ValueIndicator.Stroke.Color = NColor.Red;
			m_ValueIndicator.ScaleAxis = axis1;
			m_ValueIndicator.OffsetFromScale = 2;
				
			m_RadialGauge.Indicators.Add(m_ValueIndicator);

            // needle value indicator2
            m_ValueIndicator1 = new NNeedleValueIndicator();
            m_ValueIndicator1.Value = 79;
            m_ValueIndicator1.ScaleAxis = axis2;
            m_ValueIndicator1.OffsetFromScale = 2;
            
			m_RadialGauge.Indicators.Add(m_ValueIndicator1);

            // timer
            m_DataFeedTimer = new NTimer();
            m_DataFeedTimer.Tick += OnDataFeedTimerTick;
            m_DataFeedTimer.Start();

            return stack;
		}
		public NWidget CreateExampleControls()
        {
			NStackPanel stack = new NStackPanel();

			NStackPanel propertyStack = new NStackPanel();
			stack.Add(new NUniSizeBoxGroup(propertyStack));

			// pointer properties group
			NGroupBox controlsGroupBox = new NGroupBox("Controls");
			propertyStack.Add(controlsGroupBox);
			NStackPanel controlsGroupBoxContent = new NStackPanel();
            controlsGroupBox.Content = new NUniSizeBoxGroup(controlsGroupBoxContent);

            // value indicator 1 shape Combo
            m_ValueIndicatorShapeComboBox = new NComboBox();
            m_ValueIndicatorShapeComboBox.Items.FillFromEnum();
            m_ValueIndicatorShapeComboBox.SelectedIndex = (int)m_ValueIndicator.Shape;
            m_ValueIndicatorShapeComboBox.SelectedIndexChanged += OnValueIndicatorShapeComboBoxSelectedIndexChanged;
            controlsGroupBoxContent.Add(new NPairBox("Value Indicator 1 Shape:", m_ValueIndicatorShapeComboBox, true));

            // value indicator 1 width 
            m_ValueIndicatorWidthUpDown = new NNumericUpDown();
            m_ValueIndicatorWidthUpDown.Value = m_ValueIndicator.Width;
            m_ValueIndicatorWidthUpDown.ValueChanged += OnValueIndicatorWidthUpDownValueChanged;
            controlsGroupBoxContent.Add(new NPairBox("Value Indicator 1 Width:", m_ValueIndicatorWidthUpDown, true));

            // value indicator 2 shape Combo
            m_ValueIndicator1ShapeComboBox = new NComboBox();
            m_ValueIndicator1ShapeComboBox.Items.FillFromEnum();
            m_ValueIndicator1ShapeComboBox.SelectedIndex = (int)m_ValueIndicator1.Shape;
            m_ValueIndicator1ShapeComboBox.SelectedIndexChanged += OnValueIndicatorShape1ComboBoxSelectedIndexChanged;
            controlsGroupBoxContent.Add(new NPairBox("Value Indicator 2 Shape:", m_ValueIndicator1ShapeComboBox, true));

            // value indicator 2 width 
            m_ValueIndicator1WidthUpDown = new NNumericUpDown();
            m_ValueIndicator1WidthUpDown.Value = m_ValueIndicator.Width;
            m_ValueIndicator1WidthUpDown.ValueChanged += OnValueIndicator1WidthUpDownValueChanged;
            controlsGroupBoxContent.Add(new NPairBox("Value Indicator 2 Width:", m_ValueIndicator1WidthUpDown, true));

            // needle cap visability
            m_CheckBoxShowNeedleCap = new NCheckBox("Show Needle Cap");
            m_CheckBoxShowNeedleCap.Checked = m_CheckBoxShowNeedleCap.Checked;
            m_CheckBoxShowNeedleCap.CheckedChanged += OnShowNeedleCapChecked;
            controlsGroupBoxContent.Add(m_CheckBoxShowNeedleCap);
			
			// cap size
			m_UpDownNeedleCapSize = new NNumericUpDown();
			m_UpDownNeedleCapSize.Value = m_UpDownNeedleCapSize.Value;
			m_UpDownNeedleCapSize.ValueChanged += OnUpDownNeedleCapSizeChanged;
            controlsGroupBoxContent.Add(new NPairBox("Change Cap Size", m_UpDownNeedleCapSize, true));

            // scroll bar
            m_ScrollBar = new NHScrollBar();
			m_ScrollBar.Value = 70.0;
			m_ScrollBar.ValueChanged += OnScrollBarValueChanged;
			propertyStack.Add(new NPairBox("Percent:", m_ScrollBar, true));

            return stack;
        }

		public string GetExampleDescription()
		{
			return @"

The example demonstrates how use the begin and end percent properties of the anchor in order to change the gauge axis size.

"; } /// /// Gets the relevant documentation links for the example /// /// public (string Name, string Url)[] GetDocumentationUrls() { return new[] { ("Gauges Indicators Overview", "https://www.nevron.com/docs/openvision/gauges-indicators-overview.html"), ("Gauges Axes", "https://www.nevron.com/docs/openvision/gauges-axes.html"), }; } #endregion #region Implementation #endregion #region Event Handlers void OnValueIndicatorShapeComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { m_ValueIndicator.Shape = (ENNeedleShape)m_ValueIndicatorShapeComboBox.SelectedIndex; } private void OnValueIndicatorWidthUpDownValueChanged(NValueChangeEventArgs arg) { if (!(arg.NewValue is double)) return; m_ValueIndicator.Width = (double)arg.NewValue; } private void OnValueIndicatorShape1ComboBoxSelectedIndexChanged(NValueChangeEventArgs arg) { m_ValueIndicator1.Shape = (ENNeedleShape)m_ValueIndicator1ShapeComboBox.SelectedIndex; } private void OnValueIndicator1WidthUpDownValueChanged(NValueChangeEventArgs arg) { if (!(arg.NewValue is double)) return; m_ValueIndicator1.Width = (double)arg.NewValue; } private void OnShowNeedleCapChecked(NValueChangeEventArgs arg) { m_RadialGauge.NeedleCap.Visible = m_CheckBoxShowNeedleCap.Checked; } private void OnUpDownNeedleCapSizeChanged(NValueChangeEventArgs arg) { double capSize = m_UpDownNeedleCapSize.Value; m_RadialGauge.NeedleCap.Size = new NSize(capSize,capSize); } private void OnScrollBarValueChanged(NValueChangeEventArgs arg) { NGaugeAxis axis1 = (NGaugeAxis)m_RadialGauge.Axes[0]; NGaugeAxis axis2 = (NGaugeAxis)m_RadialGauge.Axes[1]; axis1.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, true, 0, (float)(m_ScrollBar.Value - 5)); axis2.Anchor = new NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, false, (float)m_ScrollBar.Value, 95); // RedAxisTextBox.Text = m_ScrollBar.Value.ToString(); } void OnDataFeedTimerTick() { // update the indicator m_FirstIndicatorAngle += 0.02; double value = 50.0 - Math.Cos(m_FirstIndicatorAngle) * 50.0; m_ValueIndicator.Value = value; m_ValueIndicator1.Value = value; } #endregion #region Fields NRadialGauge m_RadialGauge; NHScrollBar m_ScrollBar; NNeedleValueIndicator m_ValueIndicator; NNeedleValueIndicator m_ValueIndicator1; NComboBox m_ValueIndicatorShapeComboBox; NCheckBox m_CheckBoxShowNeedleCap; NComboBox m_ValueIndicator1ShapeComboBox; NNumericUpDown m_ValueIndicatorWidthUpDown; NNumericUpDown m_ValueIndicator1WidthUpDown; NNumericUpDown m_UpDownNeedleCapSize; NTimer m_DataFeedTimer; double m_FirstIndicatorAngle; #endregion #region Static Methods #endregion #region Constants private static readonly NSize defaultRadialGaugeSize = new NSize(300, 300); #endregion #region Nested Types #endregion } }

Download a fully functional C# (.cs) Value Indicators Type And Style Example for WinForms Solution

VB.NET Value Indicators Type And Style Example Code for Nevron Gauge for WinForms
Language: VB.NET

Imports Nevron.Nov
Imports Nevron.Nov.Chart
Imports Nevron.Nov.Dom
Imports Nevron.Nov.Graphics
Imports Nevron.Nov.Layout
Imports Nevron.Nov.UI
Imports Nevron.Nov.Windows.Forms
Imports System

Public Class Form1

#Region "Constructors"

    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.

        ' Set form title
        Text = "NOV WinForms - NValueIndicatorsStyleExample"

        ' Create the NOV example and its controls
        Dim exampleContent As NWidget = CreateExampleContent()
        Dim exampleControls As NWidget = CreateExampleControls()
        If Not exampleControls Is Nothing Then
            exampleControls.PreferredWidth = 300
        End If

        ' Place the example and its controls in a pair box
        Dim pairBox As NPairBox = New NPairBox(exampleContent, exampleControls)
        pairBox.FillMode = ENStackFillMode.First
        pairBox.FitMode = ENStackFitMode.First
        pairBox.Margins = New NMargins(NDesign.HorizontalSpacing, NDesign.VerticalSpacing)

        ' Host the example in the form
        Dim host As NNovWidgetHost(Of NWidget) = New NNovWidgetHost(Of NWidget)(pairBox)
        host.Dock = DockStyle.Fill
        Controls.Add(host)
    End Sub


#End Region

#Region "Example"

        Public Function CreateExampleContent() As NWidget
            Dim stack As NStackPanel = New NStackPanel()

            Dim controlStack As NStackPanel = New NStackPanel()
            stack.Add(controlStack)

            ' create the radial gauge
            m_RadialGauge = New NRadialGauge()
            m_RadialGauge.PreferredSize = defaultRadialGaugeSize
            controlStack.Add(m_RadialGauge)

            m_RadialGauge.Dial = New NDial(ENDialShape.Circle, New NEdgeDialRim())
            m_RadialGauge.Dial.BackgroundFill = New NStockGradientFill(NColor.DarkGray, NColor.Black)

            Dim gelEffect As NGelCapEffect = New NGelCapEffect(ENCapEffectShape.Ellipse)
            gelEffect.Margins = New NMargins(0, 0, 0, 0.5)

            m_RadialGauge.Axes.Clear()

            m_RadialGauge.SweepAngle = New NAngle(360, NUnit.Degree)

            ' create the first axis
            Dim axis1 As NGaugeAxis = New NGaugeAxis()
            axis1.Anchor = New NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, True, 0, 70)

            m_RadialGauge.Axes.Add(axis1)

            ' Scale 
            Dim scale1 = CType(axis1.Scale, NStandardScale)
            scale1.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke)
            scale1.MinorTickCount = 3
            scale1.Ruler.Fill = New NColorFill(NColor.FromColor(NColor.White, 0.4F))
            scale1.OuterMajorTicks.Fill = New NColorFill(NColor.Orange)
            scale1.Labels.Style.TextStyle.Font = New NFont("Arimo", 12, ENFontStyle.Bold)
            scale1.Labels.Style.TextStyle.Fill = New NColorFill(NColor.White)
            scale1.Labels.Style.Angle = New NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0)

            ' create the second axis
            Dim axis2 As NGaugeAxis = New NGaugeAxis()
            axis2.Anchor = New NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, False, 75, 95)

            m_RadialGauge.Axes.Add(axis2)

            ' scale
            Dim scale2 = CType(axis2.Scale, NStandardScale)
            scale2.SetPredefinedScale(ENPredefinedScaleStyle.PresentationNoStroke)
            scale2.MinorTickCount = 3
            scale2.Ruler.Fill = New NColorFill(NColor.FromColor(NColor.White, 0.4F))
            scale2.OuterMajorTicks.Fill = New NColorFill(NColor.Blue)
            scale2.Labels.Style.TextStyle.Font = New NFont("Arimo", 12, ENFontStyle.Bold)
            scale2.Labels.Style.TextStyle.Fill = New NColorFill(NColor.White)
            scale2.Labels.Style.Angle = New NScaleLabelAngle(ENScaleLabelAngleMode.Scale, 0)

            ' add range indicators
            Dim rangeIndicator As NRangeIndicator = New NRangeIndicator()
            rangeIndicator.OriginMode = ENRangeIndicatorOriginMode.ScaleMax
            rangeIndicator.Value = 100
            rangeIndicator.Palette = New NThreeColorPalette(NColor.Green, NColor.Red, NColor.Orange, 50.0)
            rangeIndicator.Stroke.Width = 0
            rangeIndicator.OffsetFromScale = 3
            rangeIndicator.BeginWidth = 15
            rangeIndicator.EndWidth = 25

            m_RadialGauge.Indicators.Add(rangeIndicator)

            ' needle value indicator1
            m_ValueIndicator = New NNeedleValueIndicator()
            m_ValueIndicator.Value = 79
            m_ValueIndicator.Fill = New NStockGradientFill(ENGradientStyle.Horizontal, ENGradientVariant.Variant1, NColor.White, NColor.Red)
            m_ValueIndicator.Stroke.Color = NColor.Red
            m_ValueIndicator.ScaleAxis = axis1
            m_ValueIndicator.OffsetFromScale = 2

            m_RadialGauge.Indicators.Add(m_ValueIndicator)

            ' needle value indicator2
            m_ValueIndicator1 = New NNeedleValueIndicator()
            m_ValueIndicator1.Value = 79
            m_ValueIndicator1.ScaleAxis = axis2
            m_ValueIndicator1.OffsetFromScale = 2

            m_RadialGauge.Indicators.Add(m_ValueIndicator1)

            ' timer
            m_DataFeedTimer = New NTimer()
            Me.m_DataFeedTimer.Tick += AddressOf OnDataFeedTimerTick
            m_DataFeedTimer.Start()

            Return stack
        End Function
        Public Function CreateExampleControls() As NWidget
            Dim stack As NStackPanel = New NStackPanel()

            Dim propertyStack As NStackPanel = New NStackPanel()
            stack.Add(New NUniSizeBoxGroup(propertyStack))

            ' pointer properties group
            Dim controlsGroupBox As NGroupBox = New NGroupBox("Controls")
            propertyStack.Add(controlsGroupBox)
            Dim controlsGroupBoxContent As NStackPanel = New NStackPanel()
            controlsGroupBox.Content = New NUniSizeBoxGroup(controlsGroupBoxContent)

            ' value indicator 1 shape Combo
            m_ValueIndicatorShapeComboBox = New NComboBox()
            m_ValueIndicatorShapeComboBox.Items.FillFromEnum(Of ENNeedleShape)()
            m_ValueIndicatorShapeComboBox.SelectedIndex = m_ValueIndicator.Shape
            Me.m_ValueIndicatorShapeComboBox.SelectedIndexChanged += AddressOf OnValueIndicatorShapeComboBoxSelectedIndexChanged
            controlsGroupBoxContent.Add(New NPairBox("Value Indicator 1 Shape:", m_ValueIndicatorShapeComboBox, True))

            ' value indicator 1 width 
            m_ValueIndicatorWidthUpDown = New NNumericUpDown()
            m_ValueIndicatorWidthUpDown.Value = m_ValueIndicator.Width
            Me.m_ValueIndicatorWidthUpDown.ValueChanged += AddressOf OnValueIndicatorWidthUpDownValueChanged
            controlsGroupBoxContent.Add(New NPairBox("Value Indicator 1 Width:", m_ValueIndicatorWidthUpDown, True))

            ' value indicator 2 shape Combo
            m_ValueIndicator1ShapeComboBox = New NComboBox()
            m_ValueIndicator1ShapeComboBox.Items.FillFromEnum(Of ENNeedleShape)()
            m_ValueIndicator1ShapeComboBox.SelectedIndex = m_ValueIndicator1.Shape
            Me.m_ValueIndicator1ShapeComboBox.SelectedIndexChanged += AddressOf OnValueIndicatorShape1ComboBoxSelectedIndexChanged
            controlsGroupBoxContent.Add(New NPairBox("Value Indicator 2 Shape:", m_ValueIndicator1ShapeComboBox, True))

            ' value indicator 2 width 
            m_ValueIndicator1WidthUpDown = New NNumericUpDown()
            m_ValueIndicator1WidthUpDown.Value = m_ValueIndicator.Width
            Me.m_ValueIndicator1WidthUpDown.ValueChanged += AddressOf OnValueIndicator1WidthUpDownValueChanged
            controlsGroupBoxContent.Add(New NPairBox("Value Indicator 2 Width:", m_ValueIndicator1WidthUpDown, True))

            ' needle cap visability
            m_CheckBoxShowNeedleCap = New NCheckBox("Show Needle Cap")
            m_CheckBoxShowNeedleCap.Checked = m_CheckBoxShowNeedleCap.Checked
            Me.m_CheckBoxShowNeedleCap.CheckedChanged += AddressOf OnShowNeedleCapChecked
            controlsGroupBoxContent.Add(m_CheckBoxShowNeedleCap)

            ' cap size
            m_UpDownNeedleCapSize = New NNumericUpDown()
            m_UpDownNeedleCapSize.Value = m_UpDownNeedleCapSize.Value
            Me.m_UpDownNeedleCapSize.ValueChanged += AddressOf OnUpDownNeedleCapSizeChanged
            controlsGroupBoxContent.Add(New NPairBox("Change Cap Size", m_UpDownNeedleCapSize, True))

            ' scroll bar
            m_ScrollBar = New NHScrollBar()
            m_ScrollBar.Value = 70.0
            Me.m_ScrollBar.ValueChanged += AddressOf OnScrollBarValueChanged
            propertyStack.Add(New NPairBox("Percent:", m_ScrollBar, True))

            Return stack
        End Function

        Public Function GetExampleDescription() As String
            Return "

The example demonstrates how use the begin and end percent properties of the anchor in order to change the gauge axis size.

" End Function ''' ''' Gets the relevant documentation links for the example ''' ''' Public Function GetDocumentationUrls() As (String, String)() Return {("Gauges Indicators Overview", "https://www.nevron.com/docs/openvision/gauges-indicators-overview.html"), ("Gauges Axes", "https://www.nevron.com/docs/openvision/gauges-axes.html")} End Function #End Region #Region "Implementation" #End Region #Region "Event Handlers" Private Sub OnValueIndicatorShapeComboBoxSelectedIndexChanged(arg As NValueChangeEventArgs) m_ValueIndicator.Shape = CType(m_ValueIndicatorShapeComboBox.SelectedIndex, ENNeedleShape) End Sub Private Sub OnValueIndicatorWidthUpDownValueChanged(arg As NValueChangeEventArgs) If Not (TypeOf arg.NewValue Is Double) Then Return m_ValueIndicator.Width = CDbl(arg.NewValue) End Sub Private Sub OnValueIndicatorShape1ComboBoxSelectedIndexChanged(arg As NValueChangeEventArgs) m_ValueIndicator1.Shape = CType(m_ValueIndicator1ShapeComboBox.SelectedIndex, ENNeedleShape) End Sub Private Sub OnValueIndicator1WidthUpDownValueChanged(arg As NValueChangeEventArgs) If Not (TypeOf arg.NewValue Is Double) Then Return m_ValueIndicator1.Width = CDbl(arg.NewValue) End Sub Private Sub OnShowNeedleCapChecked(arg As NValueChangeEventArgs) m_RadialGauge.NeedleCap.Visible = m_CheckBoxShowNeedleCap.Checked End Sub Private Sub OnUpDownNeedleCapSizeChanged(arg As NValueChangeEventArgs) Dim capSize = m_UpDownNeedleCapSize.Value m_RadialGauge.NeedleCap.Size = New NSize(capSize, capSize) End Sub Private Sub OnScrollBarValueChanged(arg As NValueChangeEventArgs) Dim axis1 = m_RadialGauge.Axes(0) Dim axis2 = m_RadialGauge.Axes(1) axis1.Anchor = New NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, True, 0, m_ScrollBar.Value - 5) axis2.Anchor = New NDockGaugeAxisAnchor(ENGaugeAxisDockZone.Top, False, m_ScrollBar.Value, 95) ' RedAxisTextBox.Text = m_ScrollBar.Value.ToString(); End Sub Private Sub OnDataFeedTimerTick() ' update the indicator m_FirstIndicatorAngle += 0.02 Dim value = 50.0 - Math.Cos(m_FirstIndicatorAngle) * 50.0 m_ValueIndicator.Value = value m_ValueIndicator1.Value = value End Sub #End Region #Region "Fields" Private m_RadialGauge As NRadialGauge Private m_ScrollBar As NHScrollBar Private m_ValueIndicator As NNeedleValueIndicator Private m_ValueIndicator1 As NNeedleValueIndicator Private m_ValueIndicatorShapeComboBox As NComboBox Private m_CheckBoxShowNeedleCap As NCheckBox Private m_ValueIndicator1ShapeComboBox As NComboBox Private m_ValueIndicatorWidthUpDown As NNumericUpDown Private m_ValueIndicator1WidthUpDown As NNumericUpDown Private m_UpDownNeedleCapSize As NNumericUpDown Private m_DataFeedTimer As NTimer Private m_FirstIndicatorAngle As Double #End Region #Region "Static Methods" #End Region #Region "Constants" Private Shared ReadOnly defaultRadialGaugeSize As NSize = New NSize(300, 300) #End Region #Region "Nested Types" #End Region End Class

Download a fully functional VB.NET (.vb) Value Indicators Type And Style Example for WinForms Solution

Related Documentation Links