且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

突出显示DataGridView中的单词?

更新时间:2023-02-01 17:02:33

解决方案是使用您的 DataGridView 中的RichTextBox 列。然后,您将能够突出显示单个单词,并且可以完全控制单元格中的格式。看看这篇文章:



DataGridView中的RichTextBox列


In my C# 3.5 Windows Forms application I have a grid (DataGridView). I would like to highlight a word inside some cell, but the grid only allows me to highlight the whole cell.

Is there any tweaks for the grid or any available usercontrol, built on DataGridView, which can highlight a single word inside DataGridView cell?

The solution would be to use a RichTextBox column in your DataGridView. Then you would be able to highlight a single word as well as have complete control over the formatting in the cell. Take a look at this article:

RichTextBox column in DataGridView