<System.ComponentModel.DefaultBindingProperty("Value")> _
Public Class GaugeControl

    Private _value As Integer
    <System.ComponentModel.Category("Lancio")> _
    Public Property Min() As Integer
        Get
            Return bar.Minimum
        End Get
        Set(ByVal value As Integer)
            bar.Minimum = value
            track.Minimum = value
        End Set
    End Property

    <System.ComponentModel.Category("Lancio")> _
    Public Property Max() As Integer
        Get
            Return bar.Maximum
        End Get
        Set(ByVal value As Integer)
            bar.Maximum = value
            track.Maximum = value
        End Set
    End Property

    <System.ComponentModel.Category("Lancio")> _
    Public Property Value() As Integer
        Get
            Return _value
        End Get
        Set(ByVal value As Integer)
            _value = value
            bar.Value = _value
            track.Value = _value
        End Set
    End Property

    Private Sub bar_MouseHover(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bar.MouseHover
        bar.Visible = False
        track.Visible = True
    End Sub

    Private Sub track_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles track.ValueChanged
        bar.Value = track.Value
        _value = bar.Value

    End Sub

    Private Sub track_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles track.MouseLeave
        bar.Visible = True
        track.Visible = False
    End Sub

    Private Sub Control_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Size = bar.Size
        Min = 0
        Max = 10
        _value = 0
    End Sub
End Class
