Problem with Shaped Windows Forms

V

Voyager

Hi, I have a problem driving me nuts!
Visual Studio has a doc that explains how to create a shaped window.
I followed the doc exactly yet the purple color that I choose as my
transparent color, which IS also on the bitmap I used as the
background of my form will not show as transparent. The purple shows
instead of being tansparent. This is a fairly simple process yet I
cannot get it to work.
Any ideas? Here are the steps I followed, in their example they set
blue to be trnsparent. (Plz note, my problem is not monitor related, I
know this).
PLEASE HELP!

In the Windows Forms Designer, click the form so that it has focus.
In the Properties window:
Set the FormBorderStyle property to None.
This property removes the title bar from the form

Set the BackgroundImage property of the form to the .bmp you created.
There is no need to add the file to the project system; this will be
done automatically when you specify it as the background image.
This property sets the bitmap image to be the background of the form.
(When used in tandem with the TransparencyKey property specified
below, this defines the shape of the form.)

Set the TransparencyKey property to the background color of the .bmp
file. In the case of the example above, you would set it to blue.
This property tells the application which parts of the form you want
to see through. (Effectively, we will "cut out" the desired shape of
the form from a rectangle.)

Note Monitors set to a color depth of greater than 24-bit can
display problems with certain parts of the form not being transparent,
despite setting of the TransparencyKey property. To avoid this
problem, ensure that the monitor's color depth is set to less than
24-bit in the Display control panel. When developing applications that
feature this transparency, keep in mind that you will have to make
your users aware of this issue.
Save the application. Run it by pressing F5.
Note that, at run time, your Windows Form now looks like your bitmap.
Also, notice that there is no title bar available for easy moving or
closing of the application. Press ALT+F4 to close your application and
continue development.
 
V

Voyager

After much research, I realized that this was because I had 32bit
color set in my sytem properties. I changed it to 16bit and it is
working now. Doh!
 
N

n3crius

Voyager said:
After much research, I realized that this was because I had 32bit
color set in my sytem properties. I changed it to 16bit and it is
working now. Doh!

that one aint working for me :(

thanks anyway :)

--
One framework to rule them all...

@@@ @@@ @@@@@@ @@@@@@@ @@@@@@@ @@@ @@@ @@@ @@@@@@
@@!@!@@@ @@! !@@ @@! @@@ @@! @@! @@@ !@@
@!@@!!@! @!!!: !@! @!@!!@! !!@ @!@ !@! !@@!!
!!: !!! !!: :!! !!: :!! !!: !!: !!! !:!
:: : ::: :: :: :: : : : : : :.:: : ::.: :

n3crius > .net programmer (c#/asp.net)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top