必须从WPF中的日历中点击两次 [英] Have to click away twice from Calendar in WPF

查看:311
本文介绍了必须从WPF中的日历中点击两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑2:谢谢大家的反馈。我通过添加到SelectedDatesChanged事件来解决问题:

>

当我在日历中选择日期时,我想单击我的开始按钮。但是,我需要点击两次去按钮:一次去分散日历,再次按下它。如果在日历中选择了一个项目,鼠标离开事件不会触发,并且Keyboard.ClearFocus()也不会将其取消焦点。



每当我选择一个日期,我怎样才能摆脱日历的焦点?
谢谢!
$ b

编辑:点击下一步的Go按钮就是一个例子。如果我想选择一个文本框,而且我刚刚选择了一个日期,我还需要点击两次才能进入文本框。主要的问题是,一旦日历交互,必须在与其他任何元素交互之前单击一下。 解决方案

p>我解决了这个问题,将其添加到我的SelectedDatesChanged事件:

$ p $ MouseCaption(null);


Edit 2: Thank you all for your feedback. I solved the problem by adding this to my SelectedDatesChanged event:

Mouse.Capture(null);

When I select a date in my calendar, I want to click my "Go" button. However, I need to click the "Go" button twice: once to de-focus the calendar, and again to actually press it. The mouse leave event does not trigger on the calendar if an item is selected inside of it, and Keyboard.ClearFocus() does not de-focus it either.

Please, how can I get rid of the calendar's focus whenever I select a date? Thank you!

Edit: Clicking the "Go" button next was merely an example; if I want to select a textbox and I have just selected a date, I would also have to click twice to enter the textbox. The main issue is that, once the calendar is interacted with, it must be clicked out of once before interacting with any other elements.

解决方案

I solved the problem by adding this to my SelectedDatesChanged event:

Mouse.Capture(null);

这篇关于必须从WPF中的日历中点击两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆