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. 그렇지 않으면 자동 변환을 사용할 수 없습니다.

적용 대상

추가 정보