惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 大强跑了

MacOS应用主菜单连接到ViewController的事件 设置ios/iPad应用允许分屏 QLabel加入点击的几种方式 记录常用的几条gitee命令 编译安装低版本的vapor toolbox vmware fusion打不开dev vmmon断裂管道 macOS升级ruby macOS生成icns文件的脚本 - 大强跑了 OBJC调试日志控制的宏定义 开发AppleScript时查看程序UI元素的工具 mac进入恢复模式 macos升级后安装cocoapods C#winform的datagridview设置选中行 Other Linker flags 添加 -Objc导致包冲突 nat打洞原理和实现 成为顶尖自由职业者必备的七个软技能之四:如何成为销售之王(转) mac下编译FFmpeg-Android iOS app submission : missing 64-bit support eclipse显示adb is down错误,无法真机调试
DataGridView自定义RichTextBox列
大强跑了 · 2018-12-15 · via 博客园 - 大强跑了

https://www.codeproject.com/Articles/31823/RichTextBox-Cell-in-a-DataGridView-2

RichText是用图片显示的,当SelectionMode为FullRowSelect,图片背景颜色设置有bug。修改Paint方法解决:

        protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates cellState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
        {
            base.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, null, null, errorText, cellStyle, advancedBorderStyle, paintParts);

            bool selected = base.Selected;
            if ((cellState | DataGridViewElementStates.Selected) == cellState)
            {
                selected = true;
            }

            Image img = GetRtfImage(rowIndex, value, selected);//base.Selected

            if (img != null)
                graphics.DrawImage(img, cellBounds.Left, cellBounds.Top);
        }