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 / September 2004

Tip: Looking for answers? Try searching our database.

Per pixel alpha blend on control (not on a form)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dnf - 22 Sep 2004 13:02 GMT
I want to make my control (and it child controls) to be alpha blended (just
like the form can do with Opacity property) but I don't know how to do it.
I attempted to use WS_EX_LAYERED style and SetLayeredWindowAttributes but
when I set this style on the control in CreateParms I got a message error
(Error creating window handle.)
I was also playing with  WS_EX_TRANSPARENT style and
ControlStyles.SupportsTransparentBackColor but those methods donʼt make
child controls transparent.

Signature

Dominik Jeske

Stoitcho Goutsev \(100\) [C# MVP] - 22 Sep 2004 14:12 GMT
Hi Dnf,

Only toplevel window can be layered. Speaking of windows form those are
Forms.

For control what you need to do is to set control's
SupportsTransparentBackColor and UserPaint style.

in the controls constructor add the following line

this.SetStyle(ControlStyles.SupportsTransparentBackColor |
ControlStyles.UserPaint , true);

The you can set alpha blended colors for control's background color.

Signature

HTH
Stoitcho Goutsev (100) [C# MVP]

>I want to make my control (and it child controls) to be alpha blended (just
> like the form can do with Opacity property) but I don't know how to do it.
[quoted text clipped - 4 lines]
> ControlStyles.SupportsTransparentBackColor but those methods don?t make
> child controls transparent.

Rate this thread:







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.