Click here to Skip to main content
15,902,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I make GUI in winforms with C#.I have a code with graphicspath, it works perfectly in isual studio 2010 but it doesn't work in visual studio 2008. Error said that graphicspath is not in drawing2D.So is it possible to make button without graphics path?
and here is my code:

What I have tried:

private void Form1_Load(object sender, EventArgs e)
{
System.Drawing.Drawing2D.GraphicsPath TrianglePath = new System.Drawing.Drawing2D.GraphicsPath();
Point[] pTPoints = { new Point(30,0), new Point(60, 60), new Point(0, 60) };
TrianglePath.AddLines(pTPoints);
button1.Size = new System.Drawing.Size(120, 120);
button1.Region = new Region(TrianglePath);
TrianglePath.Dispose();
}
Posted
Comments
Richard Deeming 17-Jan-18 15:17pm    
That error doesn't make any sense. The GraphicsPath class has been around since at least .NET 1.1:
System.Drawing.Drawing2D.GraphicsPath (.NET 1.1)[^]

Have you added a reference to the System.Drawing assembly?
Yash_007 17-Jan-18 23:49pm    
Yes i added System.Drawing reference to assembly. What should i do now?
Richard Deeming 18-Jan-18 11:01am    
Post the exact error message, and tell us which line of code it relates to.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900