当鼠标悬停在按钮上时如何显示组合框 [英] How to show a combobox when a mouse hovers over a button

查看:72
本文介绍了当鼠标悬停在按钮上时如何显示组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的WPF应用程序上有几个按钮,我希望当鼠标悬停在按钮上时显示一个ComboBox,然后您可以从ComboBox中进行选择。我希望它以类似于ToolTip的方式出现,除了是ComboBox,而不是Tooltip所在的文本框。

我希望这是有道理的。我正在重新访问我刚才写的一个程序,所以我的C#非常生疏!

Mike



什么我试过了:



我最初启用了工具提示

Hi I have several buttons on my WPF application, where I wish for a ComboBox to be displayed when the Mouse is hovered over the button, and you can then make a selection from the ComboBox. I wish it to be appear in a similar way to a ToolTip, except be a ComboBox, rather than the textbox that a Tooltip is.
I hope this makes sense. I am re-visiting a program that I wrote a while ago, so my C# is very rusty!
Mike

What I have tried:

I have initially enabled the Tooltip

推荐答案

你的用户界面模型没有意义。



唯一接近你的要求的是上下文菜单;即便如此,它也毫无意义。



如果您需要按钮来执行不同的事情,请在父母(表格)上使用单选按钮(或其他内容) )that包含用于标识单击时要执行的选项的按钮。
Your "UI model" makes no sense.

The only thing that comes close to your "requirement" is a "context menu"; and even then, it makes no sense.

If you need the button to do "different things", use radio buttons (or something) on the "parent (form)" that "contains" the button to identify what "option" it is to perform when clicked.


这篇关于当鼠标悬停在按钮上时如何显示组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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