I have a data grid I want to autosize to changed font size
I have the following code but it only changes font, not the grid
any suggestions appreciated, thanks
Dim newfont As New Font("Lucida'console", 9.0, FontStyle.Bold)
Me.GridMatrix.Font = newfont
Me.GridMatrix.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells)
Me.GridMatrix.AutoResizeRows(DataGridViewAutoSizeRowsMode.AllCells)
Me.GridMatrix.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize
GridMatrix.Refresh()