DataFormats.StringFormat フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DataFormats.StringFormat フィールドの意味・解説 

DataFormats.StringFormat フィールド

Windows フォーム文字列クラス形式を指定します。Windows フォームは、この形式を使用して文字列オブジェクトを格納します。static フィールドは読み取り専用です。

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Shared ReadOnly StringFormat
 As String
Dim value As String

value = DataFormats.StringFormat
public:
static initonly String^ StringFormat
public static final String StringFormat
解説解説

このフィールドは、データ型を指定するために、IDataObject インターフェイスと DataObject クラスで使用されます。

IDataObject または DataObject の実装に追加する場合は、IDataObject.SetData メソッドと DataObject.SetData メソッドの形式として、このフィールドを使用します。

この型のオブジェクトが存在するかどうかを確認するには、IDataObject.GetDataPresent メソッドと DataObject.GetDataPresent メソッドの形式として、このフィールドを使用します。

この型のオブジェクトを取得するには、IDataObject.GetData メソッドと DataObject.GetData メソッドの形式として、このフィールドを使用します。

メモメモ

文字列クラス形式は Windows フォーム固有の形式であり、Windows フォーム以外で作成されたアプリケーションでは認識できません。

使用例使用例
      try
          Dim myString As [String] = "This
 is a String from the ClipBoard"
          ' Sets the data to the Clipboard.   
          Clipboard.SetDataObject(myString)
          Dim myDataObject As IDataObject =
 Clipboard.GetDataObject()
          
          ' Checks whether the data is present or not in the Clipboard.
          If myDataObject.GetDataPresent(DataFormats.StringFormat)
 Then
         Dim clipString As [String] = CType(myDataObject.GetData(DataFormats.StringFormat),
 [String])
         Console.WriteLine(clipString)
          Else
         Console.WriteLine("No String information was contained
 in the clipboard.")
          End If
          catch e as Exception
        Console.WriteLine(e.Message)
      End try
   End Sub 'Main 
End Class 'DataFormats_StringFormat
try
{
    String myString = "This is a String from the ClipBoard";
    // Sets the data to the Clipboard.   
    Clipboard.SetDataObject(myString);
    IDataObject myDataObject = Clipboard.GetDataObject();

    // Checks whether the data is present or not in the Clipboard.
    if(myDataObject.GetDataPresent(DataFormats.StringFormat))
 
    {
        String clipString = (String)myDataObject.GetData(DataFormats.StringFormat);
        Console.WriteLine(clipString);
    } 
    else 
    {
        Console.WriteLine("No String information was contained in
 the clipboard.");
    }
}
catch(Exception e)
{
    Console.WriteLine(e.Message);
}

try
{
   String^ myString = "This is a String from the ClipBoard";
   // Sets the data to the Clipboard.   
   Clipboard::SetDataObject( myString );
   IDataObject^ myDataObject = Clipboard::GetDataObject();
   
   // Checks whether the data is present or not in the Clipboard.
   if ( myDataObject->GetDataPresent( DataFormats::StringFormat
 ) )
   {
      String^ clipString = (String^)(myDataObject->GetData( DataFormats::StringFormat
 ));
      Console::WriteLine( clipString );
   }
   else
   {
      Console::WriteLine( "No String information was contained in
 the clipboard." );
   }
}
catch ( Exception^ e ) 
{
   Console::WriteLine( e->Message );
}
try {
    String myString = "This is a String from the ClipBoard";

    // Sets the data to the Clipboard.   
    Clipboard.SetDataObject(myString);
    IDataObject myDataObject = Clipboard.GetDataObject();

    // Checks whether the data is present or not in the Clipboard.
    if (myDataObject.GetDataPresent(DataFormats.StringFormat))
 {
        String clipString = (String)myDataObject.
            GetData(DataFormats.StringFormat);
        Console.WriteLine(clipString);
    }
    else {
        Console.WriteLine("No String information was contained "
            + "in the clipboard.");
    }
}
catch (System.Exception e) {
    Console.WriteLine(e.get_Message());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DataFormats クラス
DataFormats メンバ
System.Windows.Forms 名前空間
GetData
SetData
GetDataPresent
GetFormats
DataObject
IDataObject
GetFormat
DataFormats.Format.Name
DataFormats.Format.Id


このページでは「.NET Framework クラス ライブラリ リファレンス」からDataFormats.StringFormat フィールドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDataFormats.StringFormat フィールドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDataFormats.StringFormat フィールド を検索

英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「DataFormats.StringFormat フィールド」の関連用語

DataFormats.StringFormat フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DataFormats.StringFormat フィールドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS