我想实现一个TimeSpanPicker,但不是以文本框的常用方式。我想让Textblock可点击,所以如果你点击/点击它,TimeSpanPicker就会出现。我试了一下这样的,但是这并不工作:具有TimeSpanPicker支持的可点击TextBlock
private void tb_Timer_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
TimeSpan TimeSpanDuration = TimeSpan.FromMilliseconds(status.duration);
TimeSpanPicker timeSpanPicker = new TimeSpanPicker();
timeSpanPicker.Max = new TimeSpan(TimeSpanDuration.Hours, TimeSpanDuration.Minutes, TimeSpanDuration.Seconds);
timeSpanPicker.Step = new TimeSpan(0, 0, 1);
}
我没有找到通过谷歌的东西并没有像演艺任何情况下()。 这在某种程度上可能吗?
在此先感谢!
对不起,我不明白这一点。我在我的项目中试过你的代码,它总是给我一个“ButtonAutomationPeer peer = new ButtonAutomationPeer(button);”的ArgumentNullException。 TimePicker和TimeSpanPicker是否一样? – S0me0ne 2012-03-09 16:17:45
我不知道这一点,但如果你有消息来源,你可以看看里面 – Ku6opr 2012-03-12 13:09:46