日期:2014-05-17 浏览次数:20801 次
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
namespace COMMON
{
public partial class TransparentInfo : System.Windows.Forms.UserControl
{
private string m_strInfo;
public void ShowInfo(string strInfo) //透明容器上显示文字
{
m_strInfo = strInfo;
this.Invalidate();
}
private void TransparentInfo_MouseEnter(object sender, EventArgs e)
{
this.Visible = true;
}
public bool drag = false;
public bool enab = false;
private Color fillColor = Color.White;
private int opacity = 75; //默认透明度
private int alpha;
public TransparentInfo()
{
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
SetStyle(ControlStyles.Opaque, true);
this.BackColor = Color.Transparent;
}
public Color FillColor
{
get
{
return this.fillColor;
}
set
{
this.fillColor = value;
if (this.Parent != null) Parent.Invalidate(this.Bounds, true);
}
&n