Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Value property

I'm using vb.net with cw and was just wondering what the difference is from an object.value and object._value

Curt
0 Kudos
Message 1 of 4
(3,257 Views)
What's an example of where you see object.value and an example of where you see object_value in the interop assemblies?

- Elton
Message 2 of 4
(3,257 Views)
I'm using a CWKnob with value pairs to control some settings on a signal analyzer

ex
StartFrequency is the name of the control

StartFrequency.Axis.ValuePairs.Item(StartFrequency.ValuePairIndex).Value

the options in the popup window after the item index value
are Name, Value and _Value

It's not that important, I'm just curious.

Curt
0 Kudos
Message 3 of 4
(3,257 Views)
Sorry ... I misread your original message. I thought it said object_value instead of object._value (I missed the period).

Anyway, the _Value property comes from the type library. If you look at it in OLE View, you'll see it's defined like this:

[id(00000000), hidden, helpcontext(0x000001f4)]
VARIANT _Value;

It's attributed as hidden, so you don't see it in VB. The hidden attribute is dropped when the type library is imported into .NET.

The reason for the _Value property is that it's defined as being the default value in VB. Default values for properties are not supported by VB.NET or C#. You could use _Value or Value, but I recommend preferring Value.

- Elton
0 Kudos
Message 4 of 4
(3,257 Views)