Clipboard.SetData(String, Object) 메서드

정의

클립보드에 지정된 데이터를 지정된 형식으로 저장합니다.

public:
 static void SetData(System::String ^ format, System::Object ^ data);
public static void SetData (string format, object data);
static member SetData : string * obj -> unit
Public Shared Sub SetData (format As String, data As Object)

매개 변수

format
String

데이터를 저장하는 데 사용할 형식을 지정하는 문자열입니다. 미리 정의된 데이터 형식 집합은 DataFormats 클래스를 참조하십시오.

data
Object

클립보드에 저장할 데이터를 나타내는 개체입니다.

예제

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


// For this example, the data to be placed on the clipboard is a simple
// string.
string textData = "I want to put this string on the clipboard.";

// After this call, the data (string) is placed on the clipboard and tagged
// with a data format of "Text".
Clipboard.SetData(DataFormats.Text, (Object)textData);
' For this example, the data to be placed on the clipboard is a simple
' string.
Dim textData As String = "I want to put this string on the clipboard."

' After this call, the data (string) is placed on the clipboard and tagged
' with a data format of "Text".
Clipboard.SetData(DataFormats.Text, CType(textData, Object))

설명

이 메서드는 자동 변환을 해당 데이터 형식이 사용 된 데이터를 추가 FileDrop 또는 Bitmap합니다. 그렇지 않으면 자동 변환은 사용할 수 없습니다.

적용 대상

추가 정보