specfying units in cm

M

madhur

Hello

I want to specify the units of my controls in cm. I have looked the
Unit class , it doesn support cm. However the UnitType enumeration has
cm in it.
I looked the UnitConverter class but Couldn find the way to specify my
units in cm.

Any Ideas? I am using .NET 2.0

Madhur
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

There is no Unit class, I suppose you mean the Unit structure.

What do you mean when you say that it doesn't support cm? The Unit
structure supports the Cm unit just fine.

I just created a Unit instance with the value 5 and the unit
UnitType.Cm. I applied it to the Width property of a form field:

fldSubject.Width = new Unit(5, UnitType.Cm);

Just as it should, it ended up in the style property of the html element:

<input name="ctl00$MainPlaceHolder$fldSubject" type="text"
id="ctl00_MainPlaceHolder_fldSubject" style="width:5cm;" />
 

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