Re: C1NumericEdit MinValue and MaxValue?

WinForms

ComponentOne's WinForms controls

C1NumericEdit MinValue and MaxValue?

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers
  •  Hi,

     how can i set the MinValue and MaxValue at runtime?

    I use Version 2.0.20083.33223

     

    thankx

      THW68

  •  
    Hello,
     
    To set the Maximum and Minimum value at runtime, you can try to make use of the PostValidating event. You can use code similar to given below. To implement the code
    you will have to drop a C1NumeriEdit and a button on the form.
     
    BEGIN CODE
     
    Public Class Form1

    Dim max As Integer

    Dim min As Integer

    Private Sub C1NumericEdit1_PostValidating(ByVal sender As Object, ByVal e As C1.Win.C1Input.PostValidationEventArgs) Handles C1NumericEdit1.PostValidating

    If e.Value > max Or e.Value < min Then

    e.Succeeded = False

    End If

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    Me.C1NumericEdit1.PostValidation.Validation = C1.Win.C1Input.PostValidationTypeEnum.PostValidatingEvent

    max = 10

    min = 4

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    max = 12

    min = 2

    End Sub

    End Class


    END CODE
     
    I hope this will help.
     
    Regards,
    John Adams
    <16121968> wrote in message news:215855@10.0.1.98...

     Hi,

     how can i set the MinValue and MaxValue at runtime?

    I use Version 2.0.20083.33223

     

    thankx

      THW68



    http://helpcentral.componentone.com/cs/forums/p/78657/215855.aspx#215855

Page 1 of 1 (2 items)