Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

CWNumEdit and VB

I would like to use CWNumeEdit in a VB6 program I am developing in order to achieve:
. Automatic range checking
. Automatic formatting of values entered

I'm encoutering a strange behaviour of CWNumEdit, in that I can enter the value '14' and the control correctly displays '14.0', but if I input '14.4' the control displays '60.0' that is the maximum allowed value for the control.

Control settings are as follows:
'Numeric' tab:
Range checking: do checking; range 0 ÷ 60
Continuous values
'Format' tab:
Style: .0 "V"

Seems that I need to scale values, but if use *.1 "V" format the control displays correctly the '14.4' value but when I input '14' this is displayed as '1.4'. Since I want to use it to facilitate the operator
in setting his test, I can't force him to input '14.0' when he simply needs 14 volts.

I guess the answer is so simple, but I haven't found it yet. Can someone please help me?
I'm using CW version 3.0.1.

Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 5
(4,077 Views)
Use of Format String of: .0 "V"

and it should work fine. FYI, .0 tells it to always have one number after the decimal point. The .1 is what is messing you up.

Best Regards,

Chris Matthews
Measurement Studio Support Manager
0 Kudos
Message 2 of 5
(4,077 Views)
Hi Chris,
I tried with .0 "V" but I still have some trouble. In the 'Example' box (format tab) I can test the format string: when I type a value in the input box, the formatted value is shown below. When I type "12.3" with the format string being .0 "V" I find that the formatted text is "123.0 V". Seems that the period is not recognized by the control (if I try inputting "12....2" I find the formatted value is "122.0 V").
Is there any relation between the numersic settings in control panel (international tab) and the behaviour of CW controls?
Thanks for your help.
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 3 of 5
(4,077 Views)
Last update for Chris.
I checked that in another computer your formatting works well, so I looked one time more to Control Panel (International settings). I solved my problems when I set currency settings the same as number settings, that is
decimal symbol: period
grouping symbol: comma
(sorry if terminology is incorrect: i'm translating from an italian version of Windows).
So my question is now: do you know of any relation between currency settings in Control Panel and CWNumEdit?
Hope to hear you soon
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(4,077 Views)
I was beginning to think that this was caused by the international settings. It may be looking at the currency decimal point in the system information instead of the numeric decimal point. I still couldn't reproduce that here though. If I changed the currency decimal point, but number formats still worked.

Chris
0 Kudos
Message 5 of 5
(4,077 Views)