焦点管理问题. [英] Focus Management question.

查看:109
本文介绍了焦点管理问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


推荐答案

当控件失去焦点时,LostFocus被触发...在您的情况下,控件实际上失去了焦点,因为新的悬停窗口打开时将获得焦点.您能使用工具提示而不是新窗口吗? ToolTips确实可以满足您的需求(在悬停时打开,在不再悬停时消失)...与常规窗口相比,它们在可放入它们中的内容受到了一定的限制.

这是我发现的一个非常简单的示例,它创建了一个不仅仅包含文本的工具提示(当然,它是用于按钮的,但是您会明白的)-http://www.c-sharpcorner .com/UploadFile/mahesh/FancyWPFTooltip07132008214937PM/FancyWPFTooltip.aspx
LostFocus gets fired when the control looses focus...in your case the control is in fact loosing focus because the new hover window will gain focus when opened.  Could you use a ToolTip rather than a new window? ToolTips do exactly what it sounds like you're looking for (open on hover and disappear when no longer hovering)...they're just sorta limited on what you can put inside of them compared to a regular window. 

Here's a really simple sample that I found of creating a ToolTip with more than just text (granted it's for a button, but you'll get the idea) -  http://www.c-sharpcorner.com/UploadFile/mahesh/FancyWPFTooltip07132008214937PM/FancyWPFTooltip.aspx


这篇关于焦点管理问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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