?
Solved

windows forms - usercontrol background transparent?

Posted on 2004-11-03
3
Medium Priority
?
1,621 Views
Last Modified: 2012-06-27
hi
this is a windows application on .net
i have a user control that needs to be transparent to show the image displayed on the background panel?
can someone plz help me on this?
0
Comment
Question by:heartguy123
1 Comment
 

Accepted Solution

by:
dguthu earned 1000 total points
ID: 12486949
To make a transparent user control you should just have to add three lines to your constructor:

SetStyle(ControlStyles.Opaque, false); // optional
SetStyle(ControlStyles.SupportsTransparentBackColor, !value);
BackColor = Color.FromArgb(0,0,0,0);

Another suggestion I have run across is define the region that is drawn for the shape of the user control by setting the Region property. You can define an irregular pattern and even cut "holes" in the middle of your control using the GraphicsPath object.

David
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month13 days, 15 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question