|
Public Class FormSlidePopUp
' Inherits PropertyEditorBase
Protected intIsCanceled As Boolean
Protected intValue As Integer
Public ReadOnly Property IsCanceled() As Boolean '= False
Get
Return intIsCanceled
End Get
End Property
Public Property Value() As Integer
Get
Return Me.intValue
End Get
Set(ByVal value As Integer)
Me.TrackBar1.Value = value
End Set
End Property
Public Property Minimun() As Integer
Get
Return Me.TrackBar1.Minimum
End Get
Set(ByVal value As Integer)
Me.TrackBar1.Minimum = value
End Set
End Property
Public Property Maximum() As Integer
Get
Return Me.TrackBar1.Maximum
End Get
Set(ByVal value As Integer)
Me.TrackBar1.Maximum = value
End Set
End Property
Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonAccept.Click
intValue = Me.TrackBar1.Value
intIsCanceled = False
Me.StartClose()
End Sub
Private Sub ButtonCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonCancel.Click
intIsCanceled = True
Me.StartClose()
End Sub
Protected Sub StartClose()
Me.Close()
'Me.Hide()
End Sub
Private Sub TextBoxValue_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBoxValue.KeyDown
If e.KeyData = Windows.Forms.Keys.Enter Then
If IsNumeric(Me.TextBoxValue.Text) Then
If Me.TextBoxValue.Text <= Me.TrackBar1.Maximum AndAlso Me.TextBoxValue.Text > Me.TrackBar1.Minimum Then
Me.TrackBar1.Value = Me.TextBoxValue.Text
Exit Sub
End If
End If
'si falla reestablezco l valor original
Me.TextBoxValue.Text = Me.TrackBar1.Value
ElseIf e.KeyData = Windows.Forms.Keys.Escape Then
Me.TextBoxValue.Text = Me.TrackBar1.Value
End If
End Sub
Private Sub TrackBar1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TrackBar1.ValueChanged
Me.TextBoxValue.Text = Me.TrackBar1.Value
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.