DataFormats.Format(String, Int32) 생성자

정의

Win32 핸들이 필요한지 여부를 나타내는 부울 값을 사용하여 DataFormats.Format 클래스의 새 인스턴스를 초기화합니다.

public:
 Format(System::String ^ name, int id);
public Format (string name, int id);
new System.Windows.Forms.DataFormats.Format : string * int -> System.Windows.Forms.DataFormats.Format
Public Sub New (name As String, id As Integer)

매개 변수

name
String

이 형식의 이름입니다.

id
Int32

이 형식의 ID 번호입니다.

예제

다음 코드 예제에서는 이름과 고유 ID 번호를 위한 새로운 형식을 만듭니다. 새 형식에 대 한 Windows 핸들이 필요 하지 않습니다. 필요한 textBox1 을 인스턴스화해야 합니다.

private:
   void CreateMyFormat2()
   {
      DataFormats::Format^ myFormat = gcnew DataFormats::Format(
         "AnotherNewFormat", 20916 );
      
      // Displays the contents of myFormat.
      textBox1->Text = String::Format( "ID value: {0}\nFormat name: {1}",
         myFormat->Id, myFormat->Name );
   }
private void CreateMyFormat2() {
    DataFormats.Format myFormat = new DataFormats.Format("AnotherNewFormat", 20916);
 
    // Displays the contents of myFormat.
    textBox1.Text = "ID value: " + myFormat.Id + '\n' +
       "Format name: " + myFormat.Name;
 }
Private Sub CreateMyFormat2()
    Dim myFormat As New DataFormats.Format("AnotherNewFormat", 20916)
       
    ' Displays the contents of myFormat.
    textBox1.Text = "ID value: " + myFormat.Id.ToString() + ControlChars.Cr _
                  + "Format name: " + myFormat.Name
End Sub

적용 대상