ToolStripItemTextRenderEventArgs.TextDirection Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur apakah teks digambar secara vertikal atau horizontal.
public:
property System::Windows::Forms::ToolStripTextDirection TextDirection { System::Windows::Forms::ToolStripTextDirection get(); void set(System::Windows::Forms::ToolStripTextDirection value); };
public System.Windows.Forms.ToolStripTextDirection TextDirection { get; set; }
member this.TextDirection : System.Windows.Forms.ToolStripTextDirection with get, set
Public Property TextDirection As ToolStripTextDirection
Nilai Properti
Salah ToolStripTextDirection satu nilai.
Contoh
Contoh kode berikut menunjukkan penggunaan anggota ini. Dalam contoh, penanganan aktivitas melaporkan terjadinya ToolStripRenderer.RenderItemText peristiwa. Laporan ini membantu Anda mempelajari kapan peristiwa terjadi dan dapat membantu Anda dalam penelusuran kesalahan.
Untuk menjalankan kode contoh, tempelkan ke dalam proyek yang berisi instans jenis yang mewarisi dari ToolStripRenderer, seperti ToolStripSystemRenderer atau ToolStripProfessionalRenderer. Kemudian beri nama instans ToolStripRenderer1
dan pastikan bahwa penanganan aktivitas dikaitkan dengan ToolStripRenderer.RenderItemText peristiwa.
private void ToolStripRenderer1_RenderItemText(Object sender, ToolStripItemTextRenderEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Text", e.Text );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "TextColor", e.TextColor );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "TextFont", e.TextFont );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "TextRectangle", e.TextRectangle );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "TextFormat", e.TextFormat );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "TextDirection", e.TextDirection );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Graphics", e.Graphics );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Item", e.Item );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "RenderItemText Event" );
}
Private Sub ToolStripRenderer1_RenderItemText(sender as Object, e as ToolStripItemTextRenderEventArgs) _
Handles ToolStripRenderer1.RenderItemText
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "Text", e.Text)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "TextColor", e.TextColor)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "TextFont", e.TextFont)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "TextRectangle", e.TextRectangle)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "TextFormat", e.TextFormat)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "TextDirection", e.TextDirection)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "Graphics", e.Graphics)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "Item", e.Item)
messageBoxVB.AppendLine()
messageBoxVB.AppendFormat("{0} = {1}", "ToolStrip", e.ToolStrip)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"RenderItemText Event")
End Sub
Berlaku untuk
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk