Compartir por


FixedLengthString.Value Propiedad

Definición

Obtiene o establece el contenido de un FixedLengthStringobjeto .

public:
 property System::String ^ Value { System::String ^ get(); void set(System::String ^ value); };
public string Value { get; set; }
member this.Value : string with get, set
Public Property Value As String

Valor de propiedad

que String contiene el valor .

Ejemplos

En el ejemplo siguiente se muestra cómo declarar y usar un FixedLengthString.

Private Sub DemoFixedLengthString()
    ' Declare a string that has a length of 7 characters and assign the
    ' initial string. The additional 5 positions will be padded with
    ' spaces.
    Dim fixedString As New FixedLengthString(7, "He")
    ' Display the string in a message box.
    MsgBox(fixedString.ToString)
    ' Assign a new value to the string.
    fixedString.Value = "Hello World"
    ' Display again. Note that only the first 7 characters are shown.
    MsgBox(fixedString.ToString)
End Sub

Comentarios

La FixedLengthString clase se puede usar para emular el comportamiento de una cadena de Visual Basic 6.0, que permite declarar una cadena con una longitud fija. No FixedLengthString se puede convertir a String; debe hacer referencia a la Value propiedad o llamar al ToString método para convertir el tipo.

Nota:

Las herramientas proporcionan funciones y objetos en el Microsoft.VisualBasic.Compatibility.VB6 espacio de nombres para actualizar de Visual Basic 6.0 a Visual Basic 2008. En la mayoría de los casos, estas funciones y objetos duplican la funcionalidad que puede encontrar en otros espacios de nombres de .NET Framework. Solo son necesarios cuando el modelo de código de Visual Basic 6.0 difiere significativamente de la implementación de .NET Framework.

Se aplica a