private void CreateButton_Click(object sender, EventArgs e) { String newName = name.Text; Pet newPet = new Pet(); newPet.setName(newName); //Tried to call YourPet form but threw an exception. Exception: // System.InvalidOperationException: 'Starting a second message loop on a single thread is not a valid operation. Use Form.ShowDialog instead.' // Application.Run(new YourPet()); }