Not sure why your solution was deleted but for future reference:
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Simple_Button_Feedback
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
CreateButton();
}
private void CreateButton()
{
Button b = new Button();
b.Content = "I'm a silly Button";
b.Click += new RoutedEventHandler(this.ButtonClick);
b.Height = 25;
b.Width = 100;
LinearGradientBrush lgb = new LinearGradientBrush();
lgb.GradientStops.Add(new GradientStop(Colors.Yellow, 0));
lgb.GradientStops.Add(new GradientStop(Colors.Green, 1));
b.Background = lgb;
Panel1.Children.Add(b);
}
protected void ButtonClick(object sender, EventArgs e)
{
MessageBox.Show("Click me again. That felt good.");
}
}
}