I am developing an application in C# and there is a requirement of the form of the main window in rounded rectangle or some times triangle type or round shape. so, how can I achieve this kind of features in C# 2008
Asked
Active
Viewed 2,826 times
1
-
yes this is windows form – bjh Hans Jan 07 '10 at 11:39
-
Duplicate. http://stackoverflow.com/questions/1326673/c-winforms-irregular-windows – Jon Seigel Jan 07 '10 at 14:53
3 Answers
0
I think this is what you're looking for:
http://www.codersource.net/csharp_custom_window_forms.aspx
Also you can google for it, there are plenty examples.

Community
- 1
- 1

Lukas Šalkauskas
- 14,191
- 20
- 61
- 77
0
Assuming this is on Windows Forms you can check these two articles on MSDN:
http://msdn.microsoft.com/en-us/library/aa289517(VS.71).aspx
http://msdn.microsoft.com/en-us/library/aa984331(VS.71).aspx
You basically have to do the following:
- Remove the form border by setting its style to None
- Set a background image that defines the shape of your form
- Set the TransparencyKey of the form to the color that should be transparent

Rune Grimstad
- 35,612
- 10
- 61
- 76
0
Look at the Region property of your form. You can create a new Region, set its shape using it's various Add... methods and then assign the region to your form's region property.

Chris Dunaway
- 10,974
- 4
- 36
- 48