Working on an English to Pig Latin translator. When I click Translate I am getting:
System.Windows.Forms.TextBox.Text: System.Windows.Forms.TextBox.Text:Syst..using System;
Here's the code I have so far, any help narrowing this down would be greatly appreciated.
Code:using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace CSA_164_Midterm { public partial class frmTranslator : Form { public frmTranslator() { InitializeComponent(); } private void btnTranslation_Click(object sender, EventArgs e) { string english = Convert.ToString(txtInput.Text); string pigLatin = ""; string firstLetter; string restOfWord; string vowels = "AEIOUaeiou"; int letterPos; foreach (string word in english.Split()) { firstLetter = word.Substring(0,1); restOfWord = word.Substring(1,word.Length - 1); letterPos = vowels.IndexOf(firstLetter); if (letterPos == -1) { pigLatin = restOfWord + firstLetter + "ay"; } else { pigLatin = word + "way"; } txtTranslation.Text = txtTranslation.ToString(); txtInput.Focus(); } } private void btnClear_Click(object sender, EventArgs e) { txtInput.Text = ""; txtTranslation.Text = ""; } private void btnExit_Click(object sender, EventArgs e) { this.Close(); } } }




Reply With Quote