public DateTimePickerView() { InitializeComponent(); CalDisplay.SelectedDatesChanged += CalDisplay_SelectedDatesChanged; DateDisplay.PreviewMouseUp += DateDisplay_PreviewMouseUp; DateDisplay.LostFocus += DateDisplay_LostFocus; DateDisplay.PreviewKeyDown += DateTimePickerView_PreviewKeyDown; DateDisplay.TextChanged += new TextChangedEventHandler(DateDisplay_TextChanged); this.Loaded += (s, e) => { AdornerLayer adLayer = GetAdornerLayer(DateDisplay); if (adLayer != null) { adLayer.Add(_upDownButtons = new TextBoxUpDownAdorner(DateDisplay)); _upDownButtons.Click += (textBox, direction) => { OnUpDown(direction); }; } }; }
public DateTimePickerView() { InitializeComponent(); CalDisplay.SelectedDatesChanged += CalDisplay_SelectedDatesChanged; DateDisplay.PreviewMouseUp += DateDisplay_PreviewMouseUp; DateDisplay.LostFocus += DateDisplay_LostFocus; DateDisplay.PreviewKeyDown += DateTimePickerView_PreviewKeyDown; DateDisplay.TextChanged += new TextChangedEventHandler(DateDisplay_TextChanged); this.Loaded += (s, e) => { AdornerLayer adLayer = GetAdornerLayer(DateDisplay); if (adLayer != null) { adLayer.Add(_upDownButtons = new TextBoxUpDownAdorner(DateDisplay)); _upDownButtons.Click += (textBox, direction) => { OnUpDown(direction); }; } }; }