Попытка открыть вторую форму Form2
Код:
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace forvard
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Form2 f2 = new Form2();
f2.Closing += form2_Closing; // оно будет вызвано когда форма будет закрываться
f2.Show();
private void f2_Closing(object sender, CancelEventArgs e)
{
}
}
}
Выдает ошибку:
Цитата:
Invalid token '+=' in class, struct, or interface member declaration
|
У меня визуал студио 2008.