Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2006

Tip: Looking for answers? Try searching our database.

specfying units in cm

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
madhur - 06 Jul 2006 19:35 GMT
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
Göran Andersson - 07 Jul 2006 15:56 GMT
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;" />

> Hello
>
[quoted text clipped - 7 lines]
>
> Madhur

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.