diff options
Diffstat (limited to 'Histacom2.Engine')
| -rw-r--r-- | Histacom2.Engine/UI/ClassicLabel.cs | 18 | ||||
| -rw-r--r-- | Histacom2.Engine/UI/ClassicStartMenuItem.cs | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/Histacom2.Engine/UI/ClassicLabel.cs b/Histacom2.Engine/UI/ClassicLabel.cs index c7007bd..4ef1201 100644 --- a/Histacom2.Engine/UI/ClassicLabel.cs +++ b/Histacom2.Engine/UI/ClassicLabel.cs @@ -12,8 +12,11 @@ namespace Histacom2.Engine.UI { public class ClassicLabel : Control { + public bool DropShadow { get; set; } + public ClassicLabel() { + SetStyle(ControlStyles.SupportsTransparentBackColor, true); TextChanged += (s, e) => Invalidate(); } @@ -21,11 +24,24 @@ namespace Histacom2.Engine.UI { base.OnPaint(e); var gfx = e.Graphics; - gfx.Clear(BackColor); + if (BackColor != Color.Transparent) 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; } + + private const int CS_DROPSHADOW = 0x00020000; + protected override CreateParams CreateParams + { + get + { + // add the drop shadow flag for automatically drawing + // a drop shadow around the form + CreateParams cp = base.CreateParams; + if (DropShadow) cp.ClassStyle |= CS_DROPSHADOW; + return cp; + } + } } } diff --git a/Histacom2.Engine/UI/ClassicStartMenuItem.cs b/Histacom2.Engine/UI/ClassicStartMenuItem.cs index 49aecd9..e009a35 100644 --- a/Histacom2.Engine/UI/ClassicStartMenuItem.cs +++ b/Histacom2.Engine/UI/ClassicStartMenuItem.cs @@ -33,7 +33,7 @@ namespace Histacom2.Engine.UI e.Graphics.DrawImage(Image, 0 + Padding.Left - Padding.Right, 0); if (!Selected) { - e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), Brushes.Black, 38, 11, sf); + if (SaveSystem.currentTheme != null) { e.Graphics.DrawString(Text, new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular), Brushes.Black, 38, 11, sf); } if (DropDownItems.Count > 0) { |
