共用方式為


Property.Value Property

Definition

Gets or sets the value of the property returned by the Property object.

public:
 property System::Object ^ default { System::Object ^ get(); void set(System::Object ^ value); };
public:
 property Platform::Object ^ default { Platform::Object ^ get(); void set(Platform::Object ^ value); };
[System.Runtime.InteropServices.DispId(0)]
public object this { [System.Runtime.InteropServices.DispId(0)] get; [System.Runtime.InteropServices.DispId(0)] set; }
[<System.Runtime.InteropServices.DispId(0)>]
[<get: System.Runtime.InteropServices.DispId(0)>]
[<set: System.Runtime.InteropServices.DispId(0)>]
member this.Value : obj with get, set
Default Public Property Value As Object

Property Value

An object.

Attributes

Examples

Sub ValueExample()  
   Dim Props As Properties  
   Dim PropObj As [Property]  
   Dim NameValPair As String  

   Props = DTE.Properties("Environment", "General")  
   MsgBox("Tools – Options – Environment – General Properties Count _  
   = " & Props.Count())  
   For Each PropObj In Props  
     NameValPair = NameValPair & (PropObj.Name & "Value = " & _  
     PropObj.Value.ToString & microsoft.VisualBasic.ControlChars.CrLf)  
   Next  
   MsgBox(NameValPair)  
End Sub  

Remarks

The Value property determines the default value for the Property object. Because this returns an object, any type of property is accessible. Objects are returned as the object type, and arrays are returned as arrays. A Property object representing multiple values returns them through the IndexedValue[], and the number of values is returned by the NumIndices. Setting the Value property works appropriately, depending on the value type.

If the property that the Property object represents is read/write at design time, then the Value property is read/write. If the property is read-only, attempting to set the Value property causes an error. If the property is write-only, attempting to return the Value property causes an error.

Applies to