Font in IE

  • Thread starter Thread starter Mircea Pleteriu
  • Start date Start date
M

Mircea Pleteriu

Hi all,

I have created a windows forms control named MyControl.
The control exposes a TextFont property of type Font.

I have created an HTML page which hosts MyControl control.
The page also contains a java script function from within I want to change
the Font property of my control.

The problem is that it throws an error if I try to assign the Font property
a string describing the font.. like

myControl.Font = "Microsoft Sans Serif, 8.25pt";

How could I set the Font property?
 
You need to create a font object. In this case, something like:

myControl.Font = new Font("Microsoft Sans Serif", 8.25F);

Pete
 
Back
Top