and I need to add the Opacity property to that control so that the user can modify its opacity by moving a slider
I searched for this and all what I found are examples to produce a static transparent control using this code
public StopWatch()
{
InitializeComponent();
SetScrollState((int)ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
}
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT
return cp;
}
}
protected void InvalidateEx()
{
if (Parent == null)
return;
Rectangle rc = new Rectangle(this.Location, this.Size);
Parent.Invalidate(rc, true);
}
protected override void OnPaintBackground(PaintEventArgs pevent)
{
//do not allow the background to be painted
}
it is always transparent
I need it dynamic like the opacity property of Windows Forms

New Topic/Question
Reply




MultiQuote





|