I want to reduce opacity for form only, not for controls on forms. I reduced opacity for form, but the panel opacity also reduced.
I don't want to reduce panel opacity. How can I to do this using c#?
I want to reduce opacity for form only, not for controls on forms. I reduced opacity for form, but the panel opacity also reduced.
I don't want to reduce panel opacity. How can I to do this using c#?
Instead of setting the opacity for a form, try to set the form to transparent backgroundcolor and use a seperate element (in WPF that could be e.g. a grid) to fill your form and set the opacity there.
Refering to this post, you can use HatchBrush Class.
using System.Drawing.Drawing2D;
private void Form1_Paint(object sender, PaintEventArgs e)
{
var hb = new HatchBrush(HatchStyle.Percent50, this.TransparencyKey);
e.Graphics.FillRectangle(hb,this.DisplayRectangle);
}