Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
GeneralRe: Implementing IDisposable Pin
Gilbert Consellado9-May-14 0:05
professionalGilbert Consellado9-May-14 0:05 
GeneralRe: Implementing IDisposable Pin
Pete O'Hanlon9-May-14 0:36
mvePete O'Hanlon9-May-14 0:36 
GeneralRe: Implementing IDisposable Pin
Gilbert Consellado9-May-14 1:11
professionalGilbert Consellado9-May-14 1:11 
GeneralRe: Implementing IDisposable Pin
Dave Kreskowiak9-May-14 1:26
mveDave Kreskowiak9-May-14 1:26 
GeneralRe: Implementing IDisposable Pin
Gilbert Consellado9-May-14 1:38
professionalGilbert Consellado9-May-14 1:38 
Questionpolling call to a url Pin
nitin_ion8-May-14 20:38
nitin_ion8-May-14 20:38 
AnswerRe: polling call to a url Pin
Pete O'Hanlon8-May-14 20:52
mvePete O'Hanlon8-May-14 20:52 
QuestionDrawing a rectangle using GraphicsPath in C# doesn't complete the drawing (GDI+) Pin
jesuraj.pradeep8-May-14 20:05
jesuraj.pradeep8-May-14 20:05 
I have to draw a rectangle using lines whose co-ordinates and measures are already provided.

In the below code, if I call CloseFigure function. C# assumes the drawing is incomplete and hence it draws an another line diagonally to close the rectangle.

If I use a AddRectangle function, the drawing is complete. No issues with that.

How can I complete a drawing, properly using lines?

private void OnPaint(object sender, PaintEventArgs e)
{
Pen redPen = new Pen(Color.Red, 2);
// Create a graphics path
GraphicsPath path = new GraphicsPath();
// Add two lines, a rectangle and an ellipse
Graphics g = e.Graphics;
path.StartFigure();

path.AddLine(20, 20, 20, 400); // left
path.AddLine(20, 20, 400, 20); //top
path.AddLine(400, 20, 400, 400); // right
path.AddLine(20, 400, 400, 400); // bottom

path.CloseFigure();
//This will close the drawing, by drawing a line between starting and ending point
}
AnswerRe: Drawing a rectangle using GraphicsPath in C# doesn't complete the drawing (GDI+) Pin
Bernhard Hiller8-May-14 21:36
Bernhard Hiller8-May-14 21:36 
AnswerRe: Drawing a rectangle using GraphicsPath in C# doesn't complete the drawing (GDI+) Pin
OriginalGriff8-May-14 21:41
mveOriginalGriff8-May-14 21:41 
QuestionSearch and Retrieving String Pin
ASPnoob8-May-14 20:01
ASPnoob8-May-14 20:01 
AnswerRe: Search and Retrieving String Pin
Mycroft Holmes8-May-14 21:21
professionalMycroft Holmes8-May-14 21:21 
AnswerRe: Search and Retrieving String Pin
V.8-May-14 23:27
professionalV.8-May-14 23:27 
AnswerRe: Search and Retrieving String Pin
Emre Ataseven11-May-14 5:50
professionalEmre Ataseven11-May-14 5:50 
QuestionHandle Task Exception In Main Thread Pin
Kevin Marois8-May-14 14:31
professionalKevin Marois8-May-14 14:31 
QuestionDeveloping a .NET obfuscator. Need feedback. Pin
ianderf8-May-14 9:17
ianderf8-May-14 9:17 
AnswerRe: Developing a .NET obfuscator. Need feedback. Pin
Richard Andrew x648-May-14 11:05
professionalRichard Andrew x648-May-14 11:05 
GeneralRe: Developing a .NET obfuscator. Need feedback. Pin
ianderf8-May-14 11:10
ianderf8-May-14 11:10 
GeneralRe: Developing a .NET obfuscator. Need feedback. Pin
Richard MacCutchan8-May-14 22:46
mveRichard MacCutchan8-May-14 22:46 
QuestionBufferedGraphics object will AutoScroll position Pin
Chris Copeland8-May-14 7:23
mveChris Copeland8-May-14 7:23 
AnswerRe: BufferedGraphics object will AutoScroll position Pin
Chris Copeland8-May-14 9:20
mveChris Copeland8-May-14 9:20 
QuestionNUnit- Custom Property Attribute display in Test Explorer window Pin
ercharu228-May-14 6:37
ercharu228-May-14 6:37 
QuestionTextTransformation with VS Packages Pin
Kani Mozhi7-May-14 23:47
Kani Mozhi7-May-14 23:47 
QuestionCustom reporting solution with SSRS Pin
Tridip Bhattacharjee7-May-14 21:03
professionalTridip Bhattacharjee7-May-14 21:03 
AnswerRe: Custom reporting solution with SSRS Pin
Mycroft Holmes7-May-14 23:21
professionalMycroft Holmes7-May-14 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.