XmlMappedRange.NumberFormatLocal 属性

获取或设置 XmlMappedRange 控件的格式代码(以用户的语言表示)。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
Property NumberFormatLocal As Object
    Get
    Set
Object NumberFormatLocal { get; set; }

属性值

类型:System.Object
XmlMappedRange 控件的格式代码(以用户的语言表示)。

备注

Format 函数与 NumberFormatNumberFormatLocal 属性使用不同的格式代码字符串。

示例

下面的代码示例使用 NumberFormat 属性设置 XmlMappedRange 中的日期字符串的格式。 该示例还使用 NumberFormatLocal 属性以用户的语言来显示日期格式。 此代码示例假定当前工作表包含一个名为 CustomerDateCell 的 XmlMappedRange

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());
}

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间