WinForms DataGridView font size

前端 未结 10 1893
半阙折子戏
半阙折子戏 2020-12-09 07:47

How do I change font size on the DataGridView?

10条回答
  •  长情又很酷
    2020-12-09 08:10

    '   Cell style
     With .DefaultCellStyle
         .BackColor = Color.Black
         .ForeColor = Color.White 
         .Font = New System.Drawing.Font("Microsoft Sans Serif", 11.0!,
       System.Drawing.FontStyle.Regular,
       System.Drawing.GraphicsUnit.Point, CType(0, Byte))
          .Alignment = DataGridViewContentAlignment.MiddleRight
     End With
    

提交回复
热议问题