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



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

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

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

   

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



DataFormats.StringFormat フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS