C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Graphics »

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: 1 out of 5Points: 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  
Sign In to add 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

About Us    Contact Us    Privacy Policy    Terms Of Use