带有控件的 WPF 工具提示
我有一个项目,我希望能够在某些控件上有一个工具提示,其中包含一些控件,例如文本框和日期选择器。这个想法是有某种带有有限图形的弹出窗口,但一些控件不会交互。
我知道如何向控件添加“正常”工具提示,但是当您移动时,工具提示会消失,因此我无法与其交互。
这可能吗?如果可以的话怎么办?如果不是的话有什么替代方法吗?
谢谢
I have a project in which i would like to be able to have a tooltip on some control that would incoporate some controls like textbox and datepicker. The idea would be to have some sort of a popup window with limited graphic but some control wo interact.
I know how to add a 'normal' tooltip to a control, but when you move, the tooltip disapear so I can't interact with it.
is this possible? If so how and if not, is there any alternative to this ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该使用
Popup
而不是ToolTip
示例。当鼠标移到
TextBox
上时,Popup
将打开,并且只要鼠标位于TextBox
或Popup 上,就会保持打开状态
使用
BooleanOrConverter
更新
要对 DataGrid 中的单元格执行此操作,您有几种选择。其中两个是在
DataTemplates
内为DataGridTemplateColumn
添加一个Popup
,或者您可以将其添加到DataGridCell Template
>。这是后者的一个例子。它将要求您在DataGrid
上设置 SelectionMode="Single" 和 SelectionUnit="Cell"You should use a
Popup
instead of aToolTip
Example. A
Popup
is opened when the mouse moves over theTextBox
and stays open as long as the mouse is over theTextBox
or thePopup
Is uses a
BooleanOrConverter
Update
To do this for a cell in
DataGrid
you have a few options. Two of them are to add aPopup
inside theDataTemplates
forDataGridTemplateColumn
, or you can add it to theDataGridCell Template
. Here is an example of the later. It will require you to set SelectionMode="Single" and SelectionUnit="Cell" on theDataGrid