I made a simple talking program when I just started learning c#. Now I am an average and know a bit about this language, and I decided to take my old program (Which was a console application) and made a new windows forms app with an Input field to Simulate Console.Readline and Output for WriteLine and a next button to move forward and submit what's there in the input field. I completed the code and made 2 lines 'Hi and What's your name' just for testing and while it should have worked, it didn't. Here's the code-
C#:
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 WinFormsApp1
{
public partial class Form1 : Form
{
public bool SubmitClick;
public int ConvNum;
public Form1()
{
InitializeComponent();
ConvNum = 1;
if (ConvNum == 1)
{
OutputText.Text = "Hi";
}
if (ConvNum == 2)
{
OutputText.Text = "What is your name?";
}
}
private void button1_MouseClick(object sender, MouseEventArgs e)
{
InputText.Text = " ";
SubmitClick = true;
ConvNum = ConvNum + 1;
}
}
}