将粗体字体应用于datagridview中的两个连续行 [英] Apply bold font to two consecutive rows in a datagridview

查看:65
本文介绍了将粗体字体应用于datagridview中的两个连续行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在datagridview中有两个连续的行,都需要加粗。我将下面一行的文本颜色更改为红色,如下所示。虽然我似乎找不到类似的粗体函数。

I have two consecutive rows in a datagridview, both of which need to be bold. I have changed the text colour for the lower row to red as follows. Although I can't seem to find a similar bold function.

cashBookRowsMarchTotals.Rows [1] .DefaultCellStyle.ForeColor = Color.Red;

推荐答案

我使用以下代码将两行加粗,但想知道是否有可能一次将粗体(或其他样式)应用于多个行/列?

I made the two rows bold using the following code, but was wondering if it is possible to apply bold (or other styles) to multiple rows/columns at a time?

cashBookRowsMarchTotals.Rows [0] .DefaultCellStyle.Font =新字体(cashBookRowsMarchTotals.Font,FontStyle.Bold);
cashBookRowsMarchTotals.Rows [1] .DefaultCellStyle.Font =新字体(cashBookRowsMarchTotals.Font,FontStyle.Bold);

这篇关于将粗体字体应用于datagridview中的两个连续行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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