KaraokePC/KaraokePlayer/TransparentPanel.cs
Brett Sanderson 385954f90f stuff working
2016-03-08 00:19:33 -05:00

40 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace KaraokePlayer
{
class TransparentPanel : PictureBox
{
public TransparentPanel()
{
this.SetStyle(ControlStyles.DoubleBuffer |
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.Opaque, true);
}
protected override void OnPaintBackground(PaintEventArgs e)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
e.Graphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300));
//base.OnPaintBackground(e);
}
protected override void OnPaint(PaintEventArgs e)
{
System.Drawing.SolidBrush myBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Red);
e.Graphics.FillRectangle(myBrush, new Rectangle(0, 0, 200, 300));
//base.OnPaintBackground(e);
}
}
}