次の方法で共有


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 関数で使用する書式指定文字列は、NumberFormat プロパティおよび NumberFormatLocal プロパティとは異なります。

次のコード例は、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 名前空間