Imports System.Windows.Forms
Imports System.Windows.Forms.Design
<System.ComponentModel.DesignerCategory("code")> _
<ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.StatusStrip)> _
Public Class ToolStripStatusNumericUpDown
Inherits Windows.Forms.ToolStripControlHost
Public Sub New()
MyBase.New(New Windows.Forms.NumericUpDown)
End Sub
<System.ComponentModel.Browsable(False)> _
Public ReadOnly Property NumericUpDownControl() As Windows.Forms.NumericUpDown
Get
Return CType(Control, NumericUpDown)
End Get
End Property
Public Property Minimum() As Integer
Get
Return NumericUpDownControl.Minimum
End Get
Set(ByVal value As Integer)
NumericUpDownControl.Minimum = value
End Set
End Property
Public Property Maximum() As Integer
Get
Return NumericUpDownControl.Maximum
End Get
Set(ByVal value As Integer)
NumericUpDownControl.Maximum = value
End Set
End Property
Public Property value() As Integer
Get
Return NumericUpDownControl.Value
End Get
Set(ByVal value As Integer)
NumericUpDownControl.Value = value
End Set
End Property
Protected Overrides Sub OnSubscribeControlEvents(ByVal control As System.Windows.Forms.Control)
MyBase.OnSubscribeControlEvents(control)
Dim valueNumericUpDownControl As NumericUpDown = CType(control, NumericUpDown)
AddHandler valueNumericUpDownControl.ValueChanged, AddressOf NumericUpDownControl_ValueChanged
End Sub
Protected Overrides Sub OnUnsubscribeControlEvents(ByVal control As System.Windows.Forms.Control)
MyBase.OnUnsubscribeControlEvents(control)
Dim valueNumericUpDownControl As NumericUpDown = CType(control, NumericUpDown)
RemoveHandler valueNumericUpDownControl.ValueChanged, AddressOf NumericUpDownControl_ValueChanged
End Sub
Public Event ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Private Sub NumericUpDownControl_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs)
RaiseEvent ValueChanged(sender, e)
End Sub
End Class