C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to display the form in Pentagonal shape


Posted Date: 10 May 2008    Resource Type: Code Snippets    Category: Graphics
Author: Balamurali BalajiMember Level: Diamond    
Rating: Points: 10



This code sample will change the shape of the form into pentagon. To run the code, paste the code in the forms' paint event.

System.Drawing.Drawing2D.GraphicsPath requiredShape = new System.Drawing.Drawing2D.GraphicsPath();
Point[] Pentagon = new Point[6];
Pentagon[0] = new Point(100, 100);
Pentagon[1] = new Point(300, 100);
Pentagon[2] = new Point(500, 300);
Pentagon[3] = new Point(300, 400);
Pentagon[4] = new Point(100, 400);
Pentagon[5] = new Point(100, 100);

requiredShape.AddPolygon(Pentagon);
this.Region = new System.Drawing.Region(requiredShape);
this.Invalidate();




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to clip a portion of image in a picturebox and display it in another picturebox
Previous Resource: To Create a Graph in Asp.net
Return to Discussion Resource Index
Post New Resource
Category: Graphics


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use