ToolStripItemTextRenderEventArgs.TextFont Propiedad
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Obtiene o establece la fuente del texto dibujado en ToolStripItem.
public:
property System::Drawing::Font ^ TextFont { System::Drawing::Font ^ get(); void set(System::Drawing::Font ^ value); };
public System.Drawing.Font TextFont { get; set; }
public System.Drawing.Font? TextFont { get; set; }
member this.TextFont : System.Drawing.Font with get, set
Public Property TextFont As Font
Font del texto dibujado en ToolStripItem.
En el ejemplo de código siguiente se muestra el uso de este miembro. En el ejemplo, un controlador de eventos informa sobre la aparición del ToolStripRenderer.RenderItemText evento. Este informe le ayuda a aprender cuándo se produce el evento y puede ayudarle a depurar.
Para ejecutar el código de ejemplo, péguelo en un proyecto que contenga una instancia de un tipo que herede de ToolStripRenderer, como o ToolStripProfessionalRendererToolStripSystemRenderer . A continuación, asigne un nombre a la instancia ToolStripRenderer1
y asegúrese de que el controlador de eventos está asociado al ToolStripRenderer.RenderItemText evento.
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
Producto | Versiones |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
Comentarios de .NET
.NET es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: