I'm using Visual Studio 2019 and Windows Form (.NET Framework), I have a windows form that has a button. I want to print something to the console after clicking this button named 'btnPrint'. I don't know what codes to put in it.
I tried Console.WriteLine("Hello World!") but no console was shown. I wait for a few minutes hoping that something shows up, but it takes a long time, so I terminate the program.
This is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Windows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnPrint_Click(object sender, EventArgs e)
{
Console.WriteLine("Hello World!");
}
}
}