DataFormats.Format(String, Int32) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the DataFormats.Format class with a Boolean that indicates whether a Win32
handle is expected.
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)
Parameters
- name
- String
The name of this format.
- id
- Int32
The ID number for this format.
Examples
The following code example creates a new format for a name and unique ID number. The new format does not require a Windows handle. It requires that textBox1
has been instantiated.
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET