Aracılığıyla paylaş


NamedRange.NumberFormatLocal Özellik

Alır veya ayarlar için biçim kodu NamedRange dil kullanıcı denetiminde.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll içinde)

Sözdizimi

'Bildirim
Property NumberFormatLocal As Object
Object NumberFormatLocal { get; set; }

Özellik Değeri

Tür: System.Object
İçin biçim kodu NamedRange dil kullanıcı denetiminde.

Notlar

Format İşlevi göründüklerinden farklı biçim dizeleri kullanır NumberFormat ve NumberFormatLocal özellikleri.

Örnekler

Aşağıdaki kod örneğinde NumberFormat bir tarih dizesi biçimi özelliği bir NamedRange.Örnek ayrıca kullanır NumberFormatLocal özelliği kullanıcının dilinde tarih biçimini görüntülemek için.

Bu örnek için belge düzeyi özelleştirmesinde içindir.

Private formatRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub ApplyNumberFormatting()
    formatRange = Me.Controls.AddNamedRange( _
        Me.Range("C1"), "formatRange")

    Me.formatRange.Value2 = "4-Apr-1974"
    Me.formatRange.NumberFormat = "m/d/yyyy"

    ' Display the number format in the language of the user.
    MessageBox.Show("The number format for the NamedRange is: " & _
        Me.formatRange.NumberFormatLocal.ToString())
End Sub
Microsoft.Office.Tools.Excel.NamedRange formatRange;
private void ApplyNumberFormatting()
{
    formatRange = this.Controls.AddNamedRange(
         this.Range["C1"], "formatRange");

    this.formatRange.Value2 = "4-Apr-1974";
    this.formatRange.NumberFormat = "m/d/yyyy";

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

NamedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı