Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNypyren

Posted 05 November 2012 - 12:34 PM

1. Make a "Windows Forms Application"
2. In the file "Form1.cs", add the following method:

protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    e.Graphics.DrawLine(Pens.Black, 0, 0, 100, 100);
}

(This assumes you're using some version of Visual Studio)

If you've never written a WinForms app in Visual Studio before, you will have to right click on the Form1.cs item in the solution explorer and select "View Code" in order to view the C# (by default it will display the visual form designer).

ProTip: You can use the code viewer by default by right clicking Form1.cs, clicking "open with...", selecting "CSharp Editor", and clicking "Set as Default".

#1Nypyren

Posted 05 November 2012 - 12:29 PM

1. Make a "Windows Forms Application"
2. In the file "Form1.cs", add the following method:

protected override void OnPaint(PaintEventArgs e)
{
    base.OnPaint(e);

    e.Graphics.DrawLine(Pens.Black, 0, 0, 100, 100);
}

PARTNERS