猿问

WPF引用WindowsForm的时间控件怎么获取值?

前台:

<WindowsFormsHost Height="23" HorizontalAlignment="Left" Name="birth" VerticalAlignment="Top" Width="120">
                <wf:DateTimePicker Name="birthday"></wf:DateTimePicker>
            </WindowsFormsHost>

在后台我怎么获取选中的时间?


拉莫斯之舞
浏览 826回答 2
2回答

梦里花落0921

前台改为:&nbsp;<WindowsFormsHost Height="23" HorizontalAlignment="Left" Name="birth" VerticalAlignment="Top" Width="120">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <wf:DateTimePicker x:Name="birthday"></wf:DateTimePicker>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </WindowsFormsHost>后台:birthday.Value 就可以了

繁花如伊

birthday.SelectedDate
随时随地看视频慕课网APP
我要回答