protected override void OnClick() { base.OnClick(); ReportTimeAEventArgs args = new ReportTimeAEventArgs(ReportTimeAEvent, this); args.ClickTime = DateTime.Now; this.RaiseEvent(args); }
private void ReportTimeAHandler(object sender, ReportTimeAEventArgs e) { FrameworkElement element = sender as FrameworkElement; string timeStr = e.ClickTime.ToLongTimeString(); string content = string.Format("{0} 到达{1} ", timeStr, element.Name); this.listBox.Items.Add(content); }