3
« on: March 25, 2015, 03:10:57 PM »
I've already done it for non-scaled values to add left padding. This allows for keeping a fixed amount of digits or characters for any value.
'**********************************
'* Padding to text
'**********************************
Private m_ValuePadCharacter As Char
Public Property ValuePadCharacter() As Char
Get
Return m_ValuePadCharacter
End Get
Set(ByVal value As Char)
m_ValuePadCharacter = value
UpdateText()
Invalidate()
End Set
End Property
Private m_ValuePadLength As Integer
Public Property ValuePadLength As Integer
Get
Return m_ValuePadLength
End Get
Set(ByVal value As Integer)
m_ValuePadLength = value
UpdateText()
Invalidate()
End Set
End Property
Changed UpdateText method
If m_ValueScaleFactor = 1 Then
If ValuePadLength > 0 Then
MyBase.Text = m_Prefix & m_Value.PadLeft(ValuePadLength, ValuePadCharacter) & _Suffix
Else
MyBase.Text = m_Prefix & m_Value & _Suffix
End If
Else
Try
MyBase.Text = Value * m_ValueScaleFactor & _Suffix
Catch ex As Exception
DisplayError("Scale Factor Error - " & ex.Message)
End Try
End If