How to do it...

  1. Create a new Windows forms project in Visual Studio called winformAsync. We will be creating a new Windows forms application so that we can create a button-click event. 
  1. On the winformAsync Forms Designer, openToolbox and select the Button control, which is found under the All Windows Forms node:
  1. Drag the Button control onto the Form1 designer.
  1. With the Button control selected, double-click on the control to create the click event in the code behind. Visual Studio will insert the event code for you:
      namespace winformAsync       {           public partial class Form1 : Form           {               public Form1()               {                   InitializeComponent();               }  private ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.