using System; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace feiruwenzi { public partial class Page : UserControl { public Page() { // Required to initialize variables InitializeComponent(); this.Loaded += new RoutedEventHandler(Page_Loaded); //委托挂钩注册,这样才有效,建议用VS或者VWD时候,用TAB键操作 } void Page_Loaded(object sender, RoutedEventArgs e) { ballmove.Begin();//动起来 } } }