Clipboard.ContainsData(String) 메서드

정의

클립보드에 지정된 데이터 형식의 데이터가 있는지 쿼리합니다.

public:
 static bool ContainsData(System::String ^ format);
public static bool ContainsData (string format);
static member ContainsData : string -> bool
Public Shared Function ContainsData (format As String) As Boolean

매개 변수

format
String

검색할 데이터의 형식입니다. 미리 정의된 형식에 대한 자세한 내용은 DataFormats를 참조하십시오.

반환

지정된 형식의 데이터가 클립보드에 있으면 true이고, 그렇지 않으면 false입니다.

예외

format이(가) null인 경우

예제

다음 예제에서는이 메서드를 사용 하는 방법을 보여 줍니다.


// After this line executes, IsHTMLDataOnClipboard will be true if
// HTML data is available natively on the clipboard; if not, it 
// will be false.
bool IsHTMLDataOnClipboard = Clipboard.ContainsData(DataFormats.Html);

// If there is HTML data on the clipboard, retrieve it.
string htmlData;
if(IsHTMLDataOnClipboard)
{

    htmlData = Clipboard.GetText(TextDataFormat.Html);
}

' After this line executes, IsHTMLDataOnClipboard will be true if
' HTML data is available natively on the clipboard; if not, it 
' will be false.
Dim IsHTMLDataOnClipboard As Boolean = Clipboard.ContainsData(DataFormats.Html)

' If there is HTML data on the clipboard, retrieve it.
Dim htmlData As String
If IsHTMLDataOnClipboard Then

    htmlData = Clipboard.GetText(TextDataFormat.Html)

End If

설명

데이터 형식에 대 한 쿼리 BitmapFileDrop 돌아갑니다 true 지정한 데이터 형식으로 데이터를 자동으로 변환할 수 있으면입니다. 다른 데이터 형식의 경우이 메서드는 다음과 같이 반환 됩니다. true 지정 된 형식으로 클립보드에 고유 하 게 사용할 수 있는 경우에 합니다.

적용 대상

추가 정보