Condividi tramite


Proprietà XmlMappedRange.NumberFormatLocal

Ottiene o imposta il codice di formattazione per il controllo XmlMappedRange nella lingua dell'utente.

Spazio dei nomi:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Sintassi

'Dichiarazione
Property NumberFormatLocal As Object
    Get
    Set
Object NumberFormatLocal { get; set; }

Valore proprietà

Tipo: System.Object
Codice di formattazione per il controllo XmlMappedRange nella lingua dell'utente.

Note

La funzione Format utilizza stringhe di codice di formattazione diverse rispetto alle proprietà NumberFormat e NumberFormatLocal.

Esempi

Nell'esempio di codice riportato di seguito viene utilizzata la proprietà NumberFormat per formattare stringhe della data in un controllo XmlMappedRange. Viene inoltre utilizzata la proprietà NumberFormatLocal per visualizzare il formato della data nella lingua dell'utente. Nell'esempio si presuppone che il foglio di lavoro corrente contenga un controllo XmlMappedRange denominato CustomerDateCell.

Private Sub ApplyNumberFormatting()
    Me.CustomerDateCell.Value2 = "4-Apr-1974"
    Me.CustomerDateCell.NumberFormat = "m/d/yyyy"

    ' Display the number format in the language of the user.
    MsgBox("The number format for CustomerDateCell is: " & _
        Me.CustomerDateCell.NumberFormatLocal.ToString())
End Sub
private void ApplyNumberFormatting()
{
    this.CustomerDateCell.Value2 = "4-Apr-1974";
    this.CustomerDateCell.NumberFormat = "m/d/yyyy";

    // Display the number format in the language of the user.
    MessageBox.Show("The number format for CustomerDateCell is: " +
        this.CustomerDateCell.NumberFormatLocal.ToString());
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

XmlMappedRange Interfaccia

Spazio dei nomi Microsoft.Office.Tools.Excel