Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

CWNumEdit increment/decrement values interchange??

I see a problem sometimes in a program I have written that has CWNumEdit buttons. These buttons change times stored in a database.

The problem is that some of the CWNumEdit buttons increment in value when you click the UP arrow, while others decrement?!? On the other hand, some of them when you click the down arrow, they increment, while others decrement!>!

This doesn't make sense to me at all. It only makes sense that when you click the up arrow, the values will increment. I checked the settings for all the buttons, and they are all the same, however, as I described, they do not respond in the same way.

Any help is appreciated!

CM
0 Kudos
Message 1 of 4
(3,418 Views)
Could you please post a small test project that reproduces this behavior? Thanks.

- Elton
0 Kudos
Message 2 of 4
(3,418 Views)
Elton:

Try this one out. Select Tuesday from the combo box then change some of the times and watch how they behave... very strange.

Thanks for the reply.

CM
0 Kudos
Message 3 of 4
(3,418 Views)
Hello

You are assigning negative values to some of the controls. You can see this if you change the format of the cwnumedit control to display numeric information. So when you increment, the value starts decreasing since it is becoming more positive. And since the time format ignores the sign of the numeric, the date decreases as you increment the value. Try assigning CWNumedit the absolute value using abs() when ever you do any assignment.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 4 of 4
(3,418 Views)