You could possibly try using these properties (modify or replace the existing Value property and add the new ValueScaleFactor property):
Private m_string As String = "0" & "°"
Private m_Value As Double = 0.0F
<Browsable(True), RefreshProperties(RefreshProperties.All), _
Description("Indicates the actual received arrow angle value in degrees. It could be any double-precision floating point value."), DefaultValue(0.0F)> _
Public Property Value() As Double
Get
Return Me.m_Value
End Get
Set(ByVal value As Double)
If Me.m_Value <> value Then
Me.m_Value = value
OnValueChanged(System.EventArgs.Empty)
Me.Invalidate()
End If
End Set
End Property
Private m_ValueScaleFactor As Double = 1.0F
<Browsable(True), RefreshProperties(RefreshProperties.All), Description("Value scale factor."), DefaultValue(1.0F)> _
Public Property ValueScaleFactor As Double
Get
Return m_ValueScaleFactor
End Get
Set(value As Double)
If value <= 0 Then value = 1
If m_ValueScaleFactor <> value Then
m_ValueScaleFactor = value
Me.Invalidate()
End If
End Set
End Property
and then modify the OnPaint sub, in the Events region, to look like this (or just replace it):
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)
'* Prevent an exception if RefreshImage was not called
If ForeColorBrush Is Nothing Then Exit Sub
e.Graphics.SmoothingMode = SmoothingMode.HighQuality
'* Static Back Image
e.Graphics.DrawImage(BackImage, 0, 0)
If Not String.IsNullOrEmpty(Me.Text) Then
e.Graphics.DrawString(Me.Text, Me.Font, ForeColorBrush, New Point(CInt(Me.Width / 2.0F), CInt(Me.Height * 0.55)), sf)
End If
'*************************************
'* Draw the Arrow
'*************************************
e.Graphics.TranslateTransform(CSng(Me.ClientRectangle.Width) / 2.0F, CSng(Me.ClientRectangle.Height) / 2.0F)
e.Graphics.RotateTransform(CSng(Me.m_Value * m_ValueScaleFactor - CSng(Me.m_zeroPosition)))
e.Graphics.TranslateTransform(-CSng(Me.ClientRectangle.Width) / 2.0F, -CSng(Me.ClientRectangle.Height) / 2.0F)
e.Graphics.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
e.Graphics.FillEllipse(ArrowGradientBrush, CurvedArrowBottomBounds)
e.Graphics.FillPolygon(ArrowGradientBrush, ArrowPoints)
'***************************************
e.Graphics.ResetTransform()
Me.m_string = String.Format(CStr(CDec(Me.m_Value * m_ValueScaleFactor) Mod CDec(360.0F)), "0") & "°"
e.Graphics.DrawString(Me.m_string, Me.Font, ForeColorBrush, New Point(CInt(Me.Width / 2.0F), CInt(Me.Height * 2.0F / 3.0F)), sf)
End Sub
Do observe all locations of the "°" character in case if you wanted it to be "%".
This Value suffix can also be changed from within the Designer if you add a property like this:
Private m_ValueSuffix As String = "°"
<Browsable(True), RefreshProperties(RefreshProperties.All), Description("Value suffix to show on the control."), DefaultValue("°")> _
Public Property ValueSuffix As String
Get
Return Me.m_ValueSuffix
End Get
Set(ByVal value As String)
If String.Compare(Me.m_ValueSuffix, value) <> 0 Then
Me.m_ValueSuffix = value
Me.Invalidate()
End If
End Set
End Property
and modify the following 2 lines of code:
Private m_string As String = "0" & "°"
to this
Private m_string As String = "0" & m_ValueSuffix
Me.m_string = String.Format(CStr(CDec(Me.m_Value * m_ValueScaleFactor) Mod CDec(360.0F)), "0") & "°"
to this
Me.m_string = String.Format(CStr(CDec(Me.m_Value * m_ValueScaleFactor) Mod CDec(360.0F)), "0") & m_ValueSuffix