How to change the font in the grid?

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."
 
T

Tim Wilson

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)
 
G

Guest

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top