How to change the font in the grid?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

My textboxes use Tahoma, 9. I want to use the same for my grid. Is is
possible? How do I do this?

I found this:
DataGrid1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))

in another forum, but I'm getting "'Point' is not a member of
'System.Drawing.GraphicsUnit'."
If I change Point to Pixel, I get "Overload resolution failed because no
accessible 'New' accepts this number of arguments."
 
I assume by your other post that you're dealing with the Compact Framework.
Not all the constructor overloads for the Font class are supported in the
Compact Framework. Try using the code below.

DataGrid1.Font = New Font("Tahoma", 9.0, FontStyle.Regular)
 
It worked! Thank You!

Tim Wilson said:
I assume by your other post that you're dealing with the Compact Framework.
Not all the constructor overloads for the Font class are supported in the
Compact Framework. Try using the code below.

DataGrid1.Font = New Font("Tahoma", 9.0, FontStyle.Regular)
 
Back
Top