Shaped Forms

  • Thread starter Thread starter Publicjoe
  • Start date Start date
P

Publicjoe

Hi guys,

I am writing an app that I wish to have a transparent background and hence a
shaped form. In the
InitializeComponent() method I set the members of the form to the following:

//-- Code -------------------------------------------

this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = false;
this.BackColor = Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)),
((System.Byte)(255)));
this.TransparencyKey = Color.FromArgb(((System.Byte)(128)),
((System.Byte)(128)), ((System.Byte)(255)));

//-- End of Code ------------------------------------

I am then drawing graphics of a clock as per
http://www.publicjoe.f9.co.uk/csharp/code/clock2/analogclock.exe
application.

This works great under windows 2000, but not XP. Can someone please point me
in the right direction.

Full code can be seen at
http://www.publicjoe.f9.co.uk/csharp/code/clock3/analogclock.cs

Thanks in advance

Publicjoe
 
Hi Bob,

In the linked file, I use GDI+ to draw on the form.
http://www.publicjoe.f9.co.uk/csharp/code/clock3/analogclock.cs

On my other PC running XP, I get a light blue background around the clock
from the above code. On windows 2000, I see the background of the destop or
other application that is there instead. Weird!

If you could compile the code above into an app and let me know what you see
on XP, I would be grateful.

I will have a look at your code that you attached to the other email later
to see how you use a bitmap to do shaped forms.

Cheers

Publicjoe
 
I will check the machine at home. The Windows 2000 machine is running 16bit
colour. It may be that I am running 32 bit on XP.

Thanks

Publicjoe
 

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

Back
Top