Non-rectangular Forms

  • Thread starter Thread starter Mustafa Rabie
  • Start date Start date
M

Mustafa Rabie

Hi All,

i am working on a non-rectangular application. I searched and looked
everywhere n all the sites and resources i found said the same thing:
1) Create image and set a certain color as the background color
2) set this image as the form's background image
3) set boarderstyle to none
4) set transperancykey to the background color of the image u created in
step 1.

but it's not working with me, i tried different colors, different image
formats,etc but nothing. I even downloaded a sample app and didn't work for
me.

Can anyone plz help me with how can this be solved?? is there a certain file
format that i need to use for this to be achieved?

Thanks
Mustafa
 
Mustafa Rabie said:
i am working on a non-rectangular application. I searched and looked
everywhere n all the sites and resources i found said the same thing:
1) Create image and set a certain color as the background color
2) set this image as the form's background image
3) set boarderstyle to none
4) set transperancykey to the background color of the image u created in
step 1.

but it's not working with me, i tried different colors, different image
formats,etc but nothing. I even downloaded a sample app and didn't work
for me.

Are you running your screen in 32 bpp mode?

Alternatively you can create a region of appropriate shape and assign it to
the form's 'Region' property at runtime:

<URL:http://www.bobpowell.net/region_from_bitmap.htm>
 
running windows xp sp2
Bob Powell said:
Just sanity check that you're running at least Windows 2000 please.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top