I’m trying to convert a console app to a form I got the form part showing up correctly working but can’t figure out how to make the program get its data from the form instead of the console any suggestions?
Console Application
namespace doomsday
{
public class doomsday
{
private string firstName;
public string GetName()
{
return this.firstName;
}//end method GetName
public doomsday()
{
Console.Write(" what is your first name: ");
this.firstName = Console.ReadLine();
}// end default constructor
public string DisplayGreeting()
{
return "Hello, " + this.GetName();
}
static void Main()
{
Application.EnableVisualStyles();
doomsday hello = new doomsday();
Console.WriteLine(hello.DisplayGreeting());
Console.ReadLine();
Application.Run(new Form1());
}
Form Application
namespace doomsday
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
to