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 MainClient { public partial class LoginForm : Form { public LoginForm() { // button starts as unclickable InitializeComponent(); btnJoin.Enabled = false; } public String Txt() { // gets text from textbox return textBox1.Text; } public void Usr(String n) { // stores text as n = username for client lblName.Text = n; } // when text is entered, allows user to click button private void textBox1_TextChanged(object sender, EventArgs e) { btnJoin.Enabled = true; } private void btnJoin_Click(object sender, EventArgs e) { // allows the button click event to happen from program.cs } } }