質問するログイン新規登録

回答編集履歴

1

コードを追加

2016/08/31 03:12

投稿

alg
alg

スコア2019

answer CHANGED
@@ -1,4 +1,13 @@
1
1
  対象の`DataGridView`のプロパティ`ColumnHeadersDefaultCellStyle`をいじってください。
2
2
  デザイナーからフォントを変更することができますので、太字を指定すればOKです。
3
3
  ![デザイナー](a03fc101c1c2238bbb3f9486b93d3bb6.png)
4
- ![CellStyle ビルダー](16467fcf9157ae883639444711146930.png)
4
+ ![CellStyle ビルダー](16467fcf9157ae883639444711146930.png)
5
+
6
+ デザイナーではなくコードで、ということでしたら、こんな感じでしょうか。
7
+ (デザイナーが自動生成したコードの抜粋ですが)
8
+
9
+ ```vb.net
10
+ Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
11
+ DataGridViewCellStyle1.Font = New System.Drawing.Font("MS UI Gothic", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(128, Byte))
12
+ Me.DataGridView1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1
13
+ ```