Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / May 2006

Tip: Looking for answers? Try searching our database.

Opaque (semi-trasparent) control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Viktar Zhardzetski - 24 May 2006 23:37 GMT
I neet to create a "Colored glass" effect, so I can cover a couple of buttons
on my form with an opaque (semi-transparent) shape and some text. I tried the
following:

1. Create a control that will support a transparent background and use ARGB
colors to set an opacity for the background (or implement custom
paintbackground). I was able to create kinda "label with transparent
background" control using text clipping technique, but not an "opaque"
background. Playing with SetStyle (AllPaintingInWmPaint, Opaque,
SupportsTransparentBackColor, ...) I was able to "burn the hole in the form"
effect (the desktop was visible through, but not other controls on nmy form)

2. Create a custom container control that will be able to draw over its
children. However, I was not able to make Graphics to draw over the children
controls.

Is it possible to create an opaque control at all?

(I did a work around by placing a whole opaque Form over needed controls,
but that's not a solution I'm looking for)

Signature

Thanks,
Viktar Z.

+ Kennedy Kok + - 25 May 2006 01:48 GMT
Have you read this?

http://www.bobpowell.net/transcontrols.htm

Kennedy

>I neet to create a "Colored glass" effect, so I can cover a couple of
>buttons
[quoted text clipped - 22 lines]
> (I did a work around by placing a whole opaque Form over needed controls,
> but that's not a solution I'm looking for)
Viktar Zhardzetski - 25 May 2006 20:03 GMT
It is a nice "trick" (Thanks for the info !) but unfortunatly, it is
absolutely not suitable for production. Using paren'ts invalidation on timer
causes a lot of flicking and still does not render correctly over several
types of controls, like ComboBox, (ComboBox's text will draw itself over the
"Transparent control" while the rest of the ComboBox will stay behind it -
weird) etc. Double buffering is not supported.

I'm still looking for another solution...

Signature

Thanks,
Viktar Z.

> Have you read this?
>
[quoted text clipped - 28 lines]
> > (I did a work around by placing a whole opaque Form over needed controls,
> > but that's not a solution I'm looking for)
Kennedy Kok - 25 May 2006 21:19 GMT
Hello Viktar,

I think the "best" solution is what you already have - using a Form and setting
it's transparency. Hopefully, vista will bring true-transparency on controls.

K

> It is a nice "trick" (Thanks for the info !) but unfortunatly, it is
> absolutely not suitable for production. Using paren'ts invalidation on
[quoted text clipped - 46 lines]
>>> Thanks,
>>> Viktar Z.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.