Public Class StTrackBar
	Implements IField
	Implements IRange
	Implements IChanged

	Dim m_Field As Fields
	Public Property Field() As Fields Implements IField.Field
		Get
			Return (m_Field)
		End Get
		Set(ByVal value As Fields)
			m_Field = value
		End Set
	End Property

	Dim m_Updatting As Boolean = True

	Public Overloads Sub SetRange(ByVal min As Decimal, ByVal max As Decimal, ByVal value As Decimal) Implements IRange.SetRange
		m_Updatting = True
		If value < min Then
			min = value
		End If
		If max < value Then
			max = value
		End If
		Me.Minimum = CInt(min)
		Me.Maximum = CInt(max)
		Me.Value = CInt(value)
		Me.LargeChange = CInt((Maximum - Minimum) / 25)
		If LargeChange <= 5 Then
			LargeChange = 5
		End If
		Me.SmallChange = CInt((Maximum - Minimum) / 50)
		If SmallChange = 0 Then
			SmallChange = 1
		End If
		Me.TickFrequency = LargeChange
		m_Updatting = False
	End Sub
	Public Function GetValue() As Decimal Implements IRange.GetValue
		Return (Me.Value)
	End Function

	Public Event Changed(ByVal sender As Object, ByVal e As EventArgs) Implements IChanged.Changed

	Private Sub StTrackBar_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Scroll
		RaiseEvent Changed(sender, e)
	End Sub
End Class
