OK, so you want your Animal to be a member variable, so that it's in scope when you push the Talk button.
public partial class Form1 : Form
{
private Animal animal;
private void btnDog_Click(object sender, EventArgs e)
{
animal = new Dog();
}
private void btnCat_Click(object sender, EventArgs e)
{
animal = new Cat();
}
private void btnTalk_Click(object sender, EventArgs e)
{
if (animal != null)
animal.Talk();
}
}
Edit: Added pre tags