C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

C1NumericEdit MinValue and MaxValue?

rated by 0 users
This post has 1 Reply | 0 Followers

Not Ranked
Posts 3
16121968 Posted: Thu, Mar 26 2009 10:01 AM

 Hi,

 how can i set the MinValue and MaxValue at runtime?

I use Version 2.0.20083.33223

 

thankx

  THW68

Top 10 Contributor
Posts 1,090
C1_JohnAd replied on Fri, Mar 27 2009 12:57 PM
 
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) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2010 ComponentOne LLC All Rights Reserved.