WinForms DataGridView font size

前端 未结 10 1839
半阙折子戏
半阙折子戏 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
    
    0 讨论(0)
  • 2020-12-09 08:17

    1st Step: Go to the form where datagridview is added

    2nd step: click on the datagridview at the top right side there will be displayed a small button of like play icon or arrow to edit the datagridview.

    3rd step: click on that button and select edit columns now click the attributes you want to increase font size.

    4th step: on the right side of the property menu the first on the list column named defaultcellstyle click on its property a new window will open to change the font and font size.

    0 讨论(0)
  • 2020-12-09 08:18

    I think it's easiest:

    First set any Label as you like (Italic, Bold, Size etc.) And:

    yourDataGridView.Font = anyLabel.Font;
    
    0 讨论(0)
  • 2020-12-09 08:19

    For changing particular single column font size use following statement

    DataGridView.Columns[1].DefaultCellStyle.Font = new Font("Verdana", 16, FontStyle.Bold);

    0 讨论(0)
提交回复
热议问题