I don't have access to Visual Studios half the time, so I rely on online .NET playgrounds. The advantage to this is that I can code online. The disadvantage is that I can only do console applications. So I'll provide a console application example of doing the same thing and try to make it as simple as possible to convert to a Windows Form Application.

Fiddle: https://dotnetfiddle.net/rT9z6Q