I have more than 20 datagridview in my project. I am trying to change the font of all datagridview. In some datagridview, font of header and alternative lines i.e. 1,3,5..... didn't change. I am trying to change programmatically rather than properties. it changed. But when I am closing application and opening it again, old font remains. I couldn't able to know why this is happend. Help me ...
Me.productsDGV.AllowUserToAddRows = False
Me.productsDGV.AllowUserToOrderColumns = True
DataGridViewCellStyle22.BackColor = System.Drawing.Color.FromArgb(CType(CType(247, Byte), Integer), CType(CType(247, Byte), Integer), CType(CType(247, Byte), Integer))
DataGridViewCellStyle22.Font = New System.Drawing.Font("Segoe UI Symbol", 10.75!)
DataGridViewCellStyle22.ForeColor = System.Drawing.Color.FromArgb(CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer))
DataGridViewCellStyle22.SelectionBackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer))
DataGridViewCellStyle22.SelectionForeColor = System.Drawing.Color.FromArgb(CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer))
Me.productsDGV.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle22
Me.productsDGV.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
Me.productsDGV.BackgroundColor = System.Drawing.Color.White
Me.productsDGV.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.productsDGV.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal
Me.productsDGV.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None
DataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
DataGridViewCellStyle23.BackColor = System.Drawing.Color.FromArgb(CType(CType(100, Byte), Integer), CType(CType(100, Byte), Integer), CType(CType(100, Byte), Integer))
DataGridViewCellStyle23.Font = New System.Drawing.Font("Segoe UI Light", 12.0!)
DataGridViewCellStyle23.ForeColor = System.Drawing.Color.White
DataGridViewCellStyle23.SelectionBackColor = System.Drawing.Color.FromArgb(CType(CType(100, Byte), Integer), CType(CType(100, Byte), Integer), CType(CType(100, Byte), Integer))
DataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText
DataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.[True]
Me.productsDGV.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle23
Me.productsDGV.ColumnHeadersHeight = 35
DataGridViewCellStyle24.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft
DataGridViewCellStyle24.BackColor = System.Drawing.Color.White
DataGridViewCellStyle24.Font = New System.Drawing.Font("Segoe UI Light", 12.0!)
DataGridViewCellStyle24.ForeColor = System.Drawing.Color.FromArgb(CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer))
DataGridViewCellStyle24.SelectionBackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer), CType(CType(240, Byte), Integer))
DataGridViewCellStyle24.SelectionForeColor = System.Drawing.Color.FromArgb(CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer), CType(CType(50, Byte), Integer))
DataGridViewCellStyle24.WrapMode = System.Windows.Forms.DataGridViewTriState.[False]
Me.productsDGV.DefaultCellStyle = DataGridViewCellStyle24
Me.productsDGV.EnableHeadersVisualStyles = False
Me.productsDGV.Location = New System.Drawing.Point(25, 110)
Me.productsDGV.Name = "productsDGV"
Me.productsDGV.ReadOnly = True
Me.productsDGV.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None
Me.productsDGV.RowHeadersVisible = False
Me.productsDGV.RowHeadersWidth = 35
Me.productsDGV.RowTemplate.Height = 35
Me.productsDGV.Size = New System.Drawing.Size(1213, 350)
Me.productsDGV.TabIndex = 1