简体   繁体   English

将控件嵌入WinForms中的工具提示中

[英]Embed a control inside a Tooltip in WinForms

is it possible to add a control to a tooltip? 是否可以在工具提示中添加控件? What im trying to achieve is a tooltip that shows some example data in a dataGridview inside the tooltip. 我试图实现的是一个工具提示,该提示在工具提示内的dataGridview中显示一些示例数据。

What I have done so far is the following: 到目前为止,我已经做了以下工作:

  1. I have created a table with some settings (dataGridview with Name (text), Type (text), Example (image), and Setting (comboBox). 我创建了一个具有一些设置的表(带有名称(文本),类型(文本),示例(图像)和设置(comboBox)的dataGridview。

ExampleImage

  1. I managed to show a tooltip with the example as string onMouseOver the example image. 我设法在示例图像中以字符串onMouseOver的形式显示了工具提示。

I'd like to embed another dataGridview in the tooltip because some examples are in table form. 我想在工具提示中嵌入另一个dataGridview,因为一些示例是表格形式的。

Tooltips are very limited. 工具提示非常有限。

The solution is to create a custom tooltip. 解决方案是创建自定义工具提示。 You do a form and make it look like a tooltip and you put on it what you want. 您做一个表格,使其看起来像一个工具提示,然后将其放在您想要的位置。

You can make it look exactly like a tooltip an you can show it and hide it with the event handlers on your datagrid. 您可以使其看起来完全像工具提示,也可以使用数据网格上的事件处理程序对其进行显示和隐藏。

我的解决方案是使用一个自定义面板,该面板显示在光标位置,并在计时器结束后淡出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM