Solved

Transparent UserControls

Posted on 2006-11-08
9
206 Views
Last Modified: 2010-04-23
I need to build a transparent control that has a true transparent background. We are building our own designer to hold controls and it seems like a very daunting task to paint the control's backcolor based upon any number of controls that could be underneath it. Is there any way to make this work?
0
Comment
Question by:PLavelle
  • 6
  • 2
9 Comments
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
Are you asking form something more than just :

Control.BackColor = Color.Transparent

???
0
 

Author Comment

by:PLavelle
Comment Utility
A transparent UserControl. Setting its backcolor to transparent doesn't work.
0
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
Seems to work for me ?

I just created a new project with a form and usercontrol. I set the backgound of the usercontrol to transparent.
added the usercontrol to the form and it was transparent ?
0
 
LVL 34

Expert Comment

by:Sancler
Comment Utility
For me, it is transparent so far as the FORM itself is concerned, but not with respect to any controls placed on the form that are behind the usercontrol.  In my test, I was able to get the "hidden" controls to show by using .SendToBack on the usercontrol.  I don't know if that would be sufficient for your purposes.

Roger
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
Ok, I see what your doing now.
Your right a transparent control will not show whats actually underneath it.

why do you need this ?  are you moving controls in a designer ?
0
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
The reason why I ask is that I've created similar projects recently and have had to use smoke and mirrors.
0
 

Author Comment

by:PLavelle
Comment Utility
Yes exactly, moving controls in a designer.
0
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 total points
Comment Utility
And you want them invisible as you move them ?

If this is the case, what I've done is used gdi to draw around the control you would be moving, then hide the the control and only drag the line via gdi.
A bit like dragging a form in windows, when all your seeing is a box where the window should be.
Then make the control visible again at the new location onmouseup event.
0
 
LVL 10

Expert Comment

by:Kinger247
Comment Utility
Hi, did this work for you ?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now