public DateTimePicker() : base() { txtDateTime.MinWidth = 80; //txtDateTime.IsReadOnly = true; txtDateTime.LostFocus += new RoutedEventHandler(txtDateTime_LostFocus); DateTimePickerButton btnSelectDateTime = new DateTimePickerButton(); string strSource = "/SMT.SAAS.Themes;component/Images/CalendarIcon-Blue.png"; btnSelectDateTime.AddButtonAction(strSource, ""); //btnSelectDateTime.Style= Application.Current.Resources["CommonButtonStyle"] as Style; btnSelectDateTime.Click += new RoutedEventHandler(btnSelectDateTime_Click); //btnSelectDateTime.AddButtonAction("image/add.png",""); btnSelectDateTime.MinWidth = 20; btnSelectDateTime.MinWidth = 20; //btnSelectDateTime.Content = "选择时间"; btnSelectDateTime.BorderThickness = new Thickness(1); //btnSelectDateTime. = ""; StackPanel pnDateTimeShow = new StackPanel(); pnDateTimeShow.Orientation = Orientation.Horizontal; pnDateTimeShow.Children.Add(txtDateTime); //pnl.Children.Add(spSpliter); pnDateTimeShow.Children.Add(btnSelectDateTime); this.Content = pnDateTimeShow; }
public DateTimePicker() : base() { txtDateTime.MinWidth = 80; //txtDateTime.IsReadOnly = true; txtDateTime.LostFocus += new RoutedEventHandler(txtDateTime_LostFocus); DateTimePickerButton btnSelectDateTime = new DateTimePickerButton(); string strSource="/SMT.SAAS.Themes;component/Images/CalendarIcon-Blue.png" ; btnSelectDateTime.AddButtonAction(strSource, ""); //btnSelectDateTime.Style= Application.Current.Resources["CommonButtonStyle"] as Style; btnSelectDateTime.Click += new RoutedEventHandler(btnSelectDateTime_Click); //btnSelectDateTime.AddButtonAction("image/add.png",""); btnSelectDateTime.MinWidth = 20; btnSelectDateTime.MinWidth = 20; //btnSelectDateTime.Content = "选择时间"; btnSelectDateTime.BorderThickness = new Thickness(1); //btnSelectDateTime. = ""; StackPanel pnDateTimeShow = new StackPanel(); pnDateTimeShow.Orientation = Orientation.Horizontal; pnDateTimeShow.Children.Add(txtDateTime); //pnl.Children.Add(spSpliter); pnDateTimeShow.Children.Add(btnSelectDateTime); this.Content = pnDateTimeShow; }