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時(shí)候,用TAB鍵操作 } void Page_Loaded(object sender, RoutedEventArgs e) { ballmove.Begin();//動(dòng)起來 } } }