Link to home
Create AccountLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

VB.net set Font Style and Size in DataGridView cell

Hi

I am using the following code to set the font in a DataGridView cell using the Fony Dialog.
The FontDialog also has Style (eg Bold) and Size. Is it possible to apply these to the DataGridView cell too? If so, what similar code would I use? Thanks

    Me.DataGridView1.Rows(oRowIndex).Cells(1).Style.Font = Me.FontDialog1.Font

I tried
    Me.DataGridView1.Rows(oRowIndex).Cells(1).Style.Font.Size = Me.FontDialog1.Font.Size
but get an error that "Property Size is read only"
ASKER CERTIFIED SOLUTION
Avatar of Murray Brown
Murray Brown
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account