Ошибка в коде, не могу разобраться - C#
Формулировка задачи:
Не могу разобраться в примитивной ошибке в коде, в результате не получается скомпилировать программу в VS2013
на запуске debug ошибка - строка 17
вот код ошибки
Error 1 A new expression requires (), [], or {} after type
Исходные коды программы:
using System.Collections.Generic;
using System.Windows.Forms;
namespace GraphCycles
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run (new GraphCycles);
}
}
}using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using GraphCycles;
namespace GraphCycles
{
public partial class Form1 : Form
{
Graphics g;
Pen pen;
public Form1()
{
InitializeComponent();
InitGraph();
}
public void InitGraph ()
{
Bitmap bmp = new Bitmap (pictureBox1.Width, pictureBox1.Height);
pictureBox1.Image = bmp;
g = Graphics.FromImage (pictureBox1.Image);
pen = new Pen (Color.DarkViolet);
g.DrawLine(pen, 0, 0, 300, 300);
}
}
}Решение задачи: «Ошибка в коде, не могу разобраться»
textual
Листинг программы
public partial class GraphCycles : Form