Timer doesn't tick : <p>Today I've tried Visual Studio + WinForms (I've been using Xamarin)
I dont use designer, just create empty project and link needed libraries.
So, my timer doesn't work properly, it ticks only in minimized form.</p>

<p>App.cs</p>

<pre><code>using System;
using System.Windows.Forms;

namespace Line
{
    class App
    {
        [STAThread]
        public static void Main()
        {
            Application.Run(new Window());
        }
    }
}
</code></pre>

<p>Window.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;

namespace Line
{
    class Window : Form
    {
        Timer timer;
        PictureBox pictureBox;
        Bitmap bmp;

        public struct Circle
        {
            public PointF position;
            public SizeF size;
        };

        List&lt;Circle&gt; circles;

        public Window()
        {
            this.Text = "Line";
            this.Size = SizeFromClientSize(new Size(640, 480));
            pictureBox = new PictureBox();
            pictureBox.Dock = DockStyle.Fill;
            pictureBox.BackColor = Color.White;
            pictureBox.Paint += new PaintEventHandler(pictureBox_Paint);
            this.Controls.Add(pictureBox);
            this.Load += new EventHandler(Window_Load);
            this.Resize += new EventHandler(Window_Resize);
            circles = new List&lt;Circle&gt;();
            timer = new Timer();
            timer.Interval = 15;
            timer.Enabled = true;
            timer.Tick += new EventHandler(timer_Tick);
        }

        private void pictureBox_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = Graphics.FromImage(bmp);
            g.Clear(Color.Black);
            foreach (Circle c in circles)
            {
                g.DrawEllipse(Pens.White, new RectangleF(c.position, c.size));
            }
            pictureBox.Image = bmp;
        }

        private void timer_Tick(object sender, EventArgs e)
        {
            Circle c;
            Console.WriteLine("Works");
            for (int i = 0; i &lt; circles.Count; i++)
            {
                c = circles[i];
                c.size.Width = (c.size.Width &gt; 200) ? 100 : c.size.Width + 1;
                circles[i] = c;
            }
            pictureBox.Invalidate();
        }

        private void Window_Load(object sender, EventArgs e)
        {
            bmp = new Bitmap(this.Width, this.Height);
            circles.Add(new Circle());
            Circle c = circles[0];
            c.position = new PointF(100, 100);
            c.size = new SizeF(100, 100);
            circles[0] = c;
        }

        private void Window_Resize(object sender, EventArgs e)
        {
            bmp = new Bitmap(this.Width, this.Height);
            pictureBox.Invalidate();
        }
    }
}
</code></pre>

<p>Same code worked fine in Xamarin.</p>
