2

I'm trying to get a form in my Windows Forms program to be borderless, invisible, and have a PictureBox control in it. The PictureBox image is set to a PNG with an alpha channel to give it a transparent background.

What I want is for the form to be completely invisible but I want the PNG with correct transparency to be visible still.

This is only going to be for Windows 7 with Aero theme on so any shortcuts Areo can afford me I can use.

I tried using a transparency key for the form like so:

this.TransparencyKey = Color.Turquoise;
this.BackColor = Color.Turquoise;

This ALMOST works except the parts of the PNG that aren't 100% transparent pick up the turquoise and gives the PNG an ugly turquoise halo around it.

EDIT: I found this article which sounds like it might be what I'm looking for but it doesn't go into specifics on implementation. Would this work for me? How do I do it?

Kyle V.
  • 4,752
  • 9
  • 47
  • 81
  • possible duplicate of [Splash-screen with alpha channels transparency/opacity in WinForms](http://stackoverflow.com/questions/851738/splash-screen-with-alpha-channels-transparency-opacity-in-winforms) – Hans Passant Mar 04 '13 at 19:25
  • @HansPassant Thanks, but I'm interested in seeing if there's an easier way to do this. I'll try this solution as a last resort. – Kyle V. Mar 04 '13 at 19:35

1 Answers1

2

I found a solution in this source code here:

http://www.codeproject.com/Articles/29184/A-lovely-goldfish-desktop-pet-using-alpha-PNG-and

Kyle V.
  • 4,752
  • 9
  • 47
  • 81