Właściwość XmlMappedRange.Text —

Pobiera tekst dla XmlMappedRange kontroli.

Przestrzeń nazw:  Microsoft.Office.Tools.Excel
Zestaw:  Microsoft.Office.Tools.Excel (w Microsoft.Office.Tools.Excel.dll)

Składnia

'Deklaracja
ReadOnly Property Text As Object
Object Text { get; }

Wartość właściwości

Typ: System.Object
Tekst dla XmlMappedRange kontroli.

Przykłady

Następujący kod dodaje porównuje przykład sposób, w jaki Text i Value2 właściwości różnią się dla sformatowanych komórek, które zawierają liczby.W tym przykładzie kodu zakłada, że bieżący arkusz zawiera XmlMappedRange o nazwie CustomerLastNameCell.

Private Sub CompareTextAndValue2()
    Me.CustomerAddress1Cell.Value2 = 1198.3
    Me.CustomerAddress1Cell.NumberFormat = "$#,##0"

    ' Displays "1198.3".
    MsgBox("The Value2 value is: " & Me.CustomerAddress1Cell.Value2.ToString())

    ' Displays "$1,198".
    MsgBox("The Text value is: " & Me.CustomerAddress1Cell.Text.ToString())
End Sub
private void CompareTextAndValue2()
{
    this.CustomerAddress1Cell.Value2 = 1198.3;
    this.CustomerAddress1Cell.NumberFormat = "$#,##0";

    // Displays "1198.3".
    MessageBox.Show("The Value2 value is: " + 
        this.CustomerAddress1Cell.Value2.ToString());

    // Displays "$1,198".
    MessageBox.Show("The Text value is: " +
        this.CustomerAddress1Cell.Text.ToString());
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

XmlMappedRange Interfejs

Przestrzeń nazw Microsoft.Office.Tools.Excel