Hallo zusammen,
wieso muß ich eigentlich eine Funktion in einer Konsolen-App als static deklarieren,
während ich dies bei einer Funktion in einer Forms-App nicht tun muß?// Konsole:
Konsole:
class Program
{
static void Main(string[] args)
{
SayHello();
Console.ReadKey();
}
static void SayHello()
{
Console.WriteLine("Hello");
}
}
Form:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SayHello();
}
void SayHello()
{
MessageBox.Show("Hello");
}
}
Danke und Gruß
Frank