diff options
Diffstat (limited to 'Histacom2.Engine/UI/ClassicLabel.cs')
| -rw-r--r-- | Histacom2.Engine/UI/ClassicLabel.cs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs new file mode 100644 index 0000000..f207eb1 --- /dev/null +++ b/Histacom2.Engine/UI/ClassicLabel.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace Histacom2.Engine.UI +{ + public class ClassicLabel : Control + { + public ClassicLabel() + { + + } + + protected override void OnPaint(PaintEventArgs e) + { + base.OnPaint(e); + var gfx = e.Graphics; + gfx.Clear(BackColor); + gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; + + gfx.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle); + Height = (int)gfx.MeasureString(Text, Font, ClientRectangle.Width).Height; + } + } +} |
