private void Form1_Load(object sender, EventArgs e) { label1.Text = "Input: "; string Playerinput; button1.Text = "Enter"; richTextBox1.ReadOnly = true; richTextBox2.ReadOnly = true; MainChar Player = new MainChar(); richTextBox1.Text = "Hello! What is your name?"; // Insert Code here Player.EXP = 0; Player.Level = 1; Player.HP = 50; Player.MP = 50; string Plevel = Player.Level.ToString(); richTextBox2.AppendText("Level: " + Plevel + " "); string PEXP = Player.EXP.ToString(); string PMP = Player.MP.ToString(); string PHP = Player.HP.ToString(); richTextBox2.AppendText("EXP: " + PEXP + " "); richTextBox2.AppendText("HP: " + PHP + " "); richTextBox2.AppendText("MP: " + PMP + " "); } } }I want to record textbox1's input to string Playerinput, but only after the user has pressed a button or the return key.
↧
Windows Form: How do I record textbox to a string only after a button is pressed?
↧