I want to build a function for holding a Button in C#. Currently it looks like this:
private Timer timer1 = new Timer();
private void cmd_haken_auf_ab_MouseDown(object sender, MouseEventArgs e)
{
Console.WriteLine("works");
timer1.Enabled = true;
timer1.Start();
}
private void cmd_haken_auf_ab_MouseUp(object sender, MouseEventArgs e)
{
Console.WriteLine("works too");
timer1.Stop();
}
private void timer1_Tick(object sender, EventArgs e)
{
Console.WriteLine("works as well");
cmd_p4.Height += 1;
}
But appearently my timer1_Tick
function is never executed, as the Output is:
works
works too
works
works too