UltimateZoneBuilder/Source/Core/Controls/TransparentPanel.cs

69 lines
1.5 KiB
C#
Raw Normal View History

2009-07-19 20:30:15 +00:00

#region ================== Copyright (c) 2007 Pascal vd Heiden
/*
* Copyright (c) 2007 Pascal vd Heiden, www.codeimp.com
* This program is released under GNU General Public License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#endregion
#region ================== Namespaces
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Globalization;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Actions;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Rendering;
using CodeImp.DoomBuilder.Editing;
#endregion
namespace CodeImp.DoomBuilder.Controls
{
public class TransparentPanel : Panel
{
#region ================== Constructor / Disposer
// Constructor
public TransparentPanel()
{
}
#endregion
#region ================== Methods
// Override this property
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x20;
return cp;
}
}
// Disable background drawing by overriding this
protected override void OnPaintBackground(PaintEventArgs e)
{
2009-07-21 15:15:38 +00:00
if(BackColor != Color.Transparent)
e.Graphics.Clear(BackColor);
2009-07-19 20:30:15 +00:00
}
#endregion
}
}