本文整理汇总了C#中System.Windows.Forms.TextRenderer.DrawText方法的典型用法代码示例。如果您正苦于以下问题:C# TextRenderer.DrawText方法的具体用法?C# TextRenderer.DrawText怎么用?C# TextRenderer.DrawText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.TextRenderer
的用法示例。
在下文中一共展示了TextRenderer.DrawText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RenderText1
private void RenderText1(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
new Point(10, 10), SystemColors.ControlText);
}
示例2: RenderText2
private void RenderText2(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
new Rectangle(10, 10, 100, 100), SystemColors.ControlText);
}
示例3: RenderText3
private void RenderText3(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "Regular Text", this.Font,
new Point(10, 10), Color.Red, Color.PowderBlue);
}
示例4: RenderText5
private void RenderText5(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "Some text.",
this.Font, new Point(10, 10), SystemColors.ControlText, TextFormatFlags.Bottom);
}
示例5: RenderText4
private void RenderText4(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "Regular Text.", this.Font,
new Rectangle(10, 10, 70, 70), SystemColors.ControlText,
SystemColors.ControlDark);
}
示例6: RenderText6
private void RenderText6(PaintEventArgs e)
{
TextFormatFlags flags = TextFormatFlags.Bottom | TextFormatFlags.EndEllipsis;
TextRenderer.DrawText(e.Graphics, "This is some text that will be clipped at the end.", this.Font,
new Rectangle(10, 10, 100, 50), SystemColors.ControlText, flags);
}
示例7: RenderText7
private void RenderText7(PaintEventArgs e)
{
TextRenderer.DrawText(e.Graphics, "This is some text.", this.Font,
new Point(10, 10), Color.White, Color.SteelBlue, TextFormatFlags.Default);
}
示例8: RenderText8
private void RenderText8(PaintEventArgs e)
{
TextFormatFlags flags = TextFormatFlags.Bottom | TextFormatFlags.WordBreak;
TextRenderer.DrawText(e.Graphics, "This is some text that will display on multiple lines.", this.Font,
new Rectangle(10, 10, 100, 50), SystemColors.ControlText, SystemColors.ControlDark, flags);
}