aboutsummaryrefslogtreecommitdiff
path: root/Histacom2.Engine
diff options
context:
space:
mode:
Diffstat (limited to 'Histacom2.Engine')
-rw-r--r--Histacom2.Engine/UI/ClassicLabel.cs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs
index 0b9d9c2..f207eb1 100644
--- a/Histacom2.Engine/UI/ClassicLabel.cs
+++ b/Histacom2.Engine/UI/ClassicLabel.cs
@@ -21,9 +21,11 @@ namespace Histacom2.Engine.UI
{
base.OnPaint(e);
var gfx = e.Graphics;
+ gfx.Clear(BackColor);
gfx.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
- gfx.DrawString(Text, Font, new SolidBrush(ForeColor), 0, 0);
+ gfx.DrawString(Text, Font, new SolidBrush(ForeColor), ClientRectangle);
+ Height = (int)gfx.MeasureString(Text, Font, ClientRectangle.Width).Height;
}
}
}