Home > Net >  Date of the inside of the WPF controls can have a select box??
Date of the inside of the WPF controls can have a select box??

Time:10-05

Need a date with a select box, but found that under the Winform is easy to implement, under the WPF didn't,,, how to achieve this??

CodePudding user response:

Are there not DatePicker?
https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.controls.datepicker

CodePudding user response:

reference 1st floor github_36000833 response:
DatePicker is not have?
https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.controls.datepicker


If is Winform, I wouldn't ask to CSDN

CodePudding user response:

The DatePicker is, how can not,

CodePudding user response:

WPF is DatePicker.
WPF toolkit that you just don't use it
Lu xaml code directly, WPF development, basic use is less than the toolkit

CodePudding user response:

reference 4 floor stherix response:
WPF is DatePicker.
WPF toolkit that you just don't use it
Lu xaml code directly, WPF development, basic use is less than the toolkit


I want a date controls, the front have a select box, can choose the date is the effective use, similar to my winform effect

CodePudding user response:

reference exception92 reply: 3/f
DatePicker is, why not,



I want a date controls, the front have a select box, can choose the date is the effective use, similar to my winform effect

CodePudding user response:

WinForm effect you like, you directly use the DateTimePicker control is the same:

 & lt; Windows x: 
XMLNS="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
XMLNS: x="http://schemas.microsoft.com/winfx/2006/xaml"
XMLNS: wf="CLR - namespace: System. Windows. Forms; The assembly=System. Windows. Forms
"Title="MainWindow" Height="450" Width="800" & gt;
& lt; Grid>
& lt; WindowsFormsHost Width="200" Height="42" & gt;
& lt; Wf: DateTimePicker/& gt;
& lt;/WindowsFormsHost>
& lt;/Grid>
& lt;/Window>

You need to add references:
1, WindowsFormsIntegration
2, System. Windows. Forms

The details see:
[drills: bearing Windows forms control in WPF]
https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/advanced/walkthrough-hosting-a-windows-forms-control-in-wpf

CodePudding user response:

Do with WPF development, basic did not use native controls, write their own style,
  •  Tags:  
  • C #
  • Related