DGV单元格内文本的工具提示 [英] Tooltip for the Text Inside a DGV Cell

查看:78
本文介绍了DGV单元格内文本的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



这是我在这个网站上的第一篇文章,最后我尝试了所有的资源后,我只想知道我想做什么是可能的。



在此帖子被标记为重复之前我想提一个具体的细节。让我在下面解释一下(为什么它不是一个重复的帖子!):



我目前在我的应用程序中有位置,如果用户将鼠标悬停在RICHTEXTBOX内的某些文本上,根据他是否悬停在控件内的某个关键字上,会显示工具提示。



现在,他们已经要求我实现这种相同类型的功能,对于我们拥有的一个datagridviews,在某个列内,该列的单元格应该具有鼠标悬停在单元格内某个关键字上的相同功能。



通常,您只有整个单元格内容的悬停功能(工具提示)和据我所知,它不适用于单元格内的个别关键词。



我想知道的是,是否有可行的方法来做什么我需要做什么?

另外,我正在VB.net下的Windows窗体应用程序上工作。



感谢所有帮助。

谢谢!

Hello All,

This is my first post on this site, finally after having tried all of my resources I just want to know if what I want to do is possible.

Before this post gets flagged for duplication I want to mention a specific detail. Let me explain below (why it isnt a duplicate post!):

I currently have places in my application where, if the user hovers over certain text inside a RICHTEXTBOX, depending on if he hovers over a certain key word inside the control, a tooltip is displayed.

Now, they have asked me to implement this same type of functionality, for one of the datagridviews that we have, where inside a certain column, the cells of that column should have this same functionality of mouse hover on a certain key word inside the cell.

Usually, you only have the hover functionality(tooltip) for the whole cell content and as far as I know, it is not available for individual Key words inside a cell.

All I want to know is that, is there a feasible way to do what I need to do?
Aditionally, I am working on windows forms application under VB.net.

All help is appreciated.
Thank you!

推荐答案

有的没有标准的方式来做到这一点,但是(尽管我还没有尝试过)它很可能。

有一个 DataGridView.CellToolTipTextNeeded Event [ ^ ],允许您设置工具提示文本在飞行中。复杂性将解决你已经结束的那个词!

这可能需要一堆调用MeasureString和一定程度的试错才能正确。



但是,通过一些努力它应该是可能的。
There's no "standard" way to do that, but (although I haven't tried) it shoudl be possible.
There is a DataGridView.CellToolTipTextNeeded Event[^] which allows you to set the ToolTip text "on the fly". The complication will be working out which word you are over!
That's probably going to need a bunch of calls to MeasureString and a degree of trial and error to get right.

But yes, with some effort it should be possible.


这篇关于DGV单元格内文本的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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