Use the sender
argument and pass it to your SoundRoute
method.. that is actually what its for:
public void SoundRoute(object sender)
{
if (((Button)sender).Text == string.Empty)//This is the line I'm having trouble with. I want the string of myButton to be converted to button1, button2, etc.
{
SoundCall subForm = new SoundCall();
subForm.Show();
}
}
Then your events become:
private void button1_Click(object sender, EventArgs e)//This will be replicated for every button on the Form
{
SoundRoute(sender);
}
Then, you can have a single event that all buttons are wired up to (since it "will be replicated for all buttons on the form").