![]() |
Checking for allowed values in propertygrid |
Post Reply ![]() |
Author | |
wakerunner ![]() Groupie ![]() Joined: 29 September 2007 Status: Offline Points: 85 |
![]() ![]() ![]() ![]() ![]() Posted: 14 March 2008 at 1:23am |
The code below works when you step through it 1 line at a time, however when you run the program it does not work. I am doing something wrong? Is there another/better way to chack values and correct if they are not an acceptable range? I am trying to make sure the entry is a number between 0 and 5.
Private Sub PG1_AfterEdit(ByVal Item As XtremePropertyGrid.IPropertyGridItem, NewValue As String, Cancel As Boolean)
NewValue = Left$(Trim$(NewValue), 1) If Val(NewValue) > 5 Then NewValue = "5"
Item.Value = NewValue
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
Thanks, looks like its our bug. :(
Please use ValueChanged instead:
Private Sub PropertyGrid1_ValueChanged(ByVal Item As XtremePropertyGrid.IPropertyGridItem) If Item.Value > 5 Then Item.Value = 5 End Sub |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |