VITI: Dik, budu toho potrebovat vic.
Tohle mu dava - Keyword 'this' is not valid in a static property, static method, or static field initializer.
Kdyz mam aplikaci, kde mam Form1, jak tam presne udelam tu instanci v ramci toho Program.cs, ktery resi vstupy z cmd?
Mam to tahle:
Program.cs:
static void Main(string[] args)
{
..
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
// Pak zkousim udelat instanci toho formu1:
Form1 F = new Form1();
// Pak ten click:
F.button1_Click(this, EventArgs.Empty);