Create a GUI application called IGPAY that lets a user enter a word. Then, when the user clicks a button, your program will generate and display the Pig Latin equivalent of that word. (To do this you remove the first letter of the word, then add that letter to the end of the word plus the letters "ay." For example, fish would become ishfay and ball would become allbay.) Make sure the GUI is attractive in appearance and that all labels, textboxes, buttons, and similar are clearly labeled. Hint: store the word in a string and consider using the Substring method. Also remember that the Length property of a string will tell you its length. See pages 79-80 of the text for examples.
Here is the code I came up with. I am new to this language and have a little knowledge with Python, but I'm just not understanding why it throws me an "Out of range exception" error. I am trying to make it so the code accepts any word and displays it in pig Latin.
private void button1_Click(object sender, EventArgs e)
{
string word;
string first;
string rest;
string full;
word = textBox1.Text;
first = word.Substring(0);
rest = word.Substring(1, word.Length);
full = rest + first + "ay";
label2.Text = full;
}