Hi, I created some buttons in Code like this.
if (infoLoader.categoriesLoaded)
{
sideBarButtons = new Button[infoLoader.categoriesLength];
for (int i = 0; i < sideBarButtons.Length; i++)
{
sideBarButtons[i] = new Button();
sideBarButtons[i].Content = infoLoader.categories[i].name;
Canvas.SetLeft(sideBarButtons[i], 30);
Canvas.SetTop(sideBarButtons[i], 110 + (40 * i));
sideBarButtons[i].Click += new EventHandler(this.SideButton_Click);
leftSideBar.Children.Add(sideBarButtons[i]);
}
}
With the Button Event handling function like this:
private void SideButton_Click(object sender, EventArgs e)
{
// Uhh
Console.WriteLine("The Button has been clicked.");
mainText.Text = infoLoader.games[0].id.ToString() + ", " + infoLoader.games[0].name + ": " + infoLoader.games[0].description;
MainLaunchBtn.Content = "Launch " + infoLoader.games[0].name;
}
And it's giving me the error:
Error 1 No overload for 'SideButton_Click' matches delegate 'System.EventHandler'
I'm kind of confused as to what I'm missing here, and any help would be appreciated. Thanks,
Andy