mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-12-11 12:51:20 +00:00
41 lines
1.1 KiB
C#
Executable file
41 lines
1.1 KiB
C#
Executable file
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
// [ZZ] this is a copypasted version of TransparentPanel :)
|
|
// implements the same functionality, except for a TrackBar, for use in tab controls.
|
|
|
|
namespace CodeImp.DoomBuilder.Controls
|
|
{
|
|
public class TransparentTrackBar : TrackBar
|
|
{
|
|
#region ================== Constructor / Disposer
|
|
|
|
// Constructor
|
|
public TransparentTrackBar()
|
|
{
|
|
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
protected override void OnCreateControl()
|
|
{
|
|
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
|
|
if (Parent != null)
|
|
BackColor = Parent.BackColor;
|
|
|
|
base.OnCreateControl();
|
|
}
|
|
|
|
// Disable background drawing by overriding this
|
|
protected override void OnPaintBackground(PaintEventArgs e)
|
|
{
|
|
if (BackColor != Color.Transparent)
|
|
e.Graphics.Clear(BackColor);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|