Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > Basic Measurement Conversion Programs


Reply
 
Thread Tools Display Modes
  #1  
Old 10-09-2005, 08:13 PM
Spazztic2003 Spazztic2003 is offline
Newcomer
 
Join Date: Oct 2005
Location: Michigan, USA
Posts: 5
Default Basic Measurement Conversion Programs


I'm fairly new with VB, and using it in my CP Programming classes, and I've run into some trouble that my book doesn't have the answer for: Conversions! It says nothing about it, and I have to do a mini-project on it, but I lost all background knowledge on how to do these.

I have to make a basic conversion into a label for feet-to-inches, centimeters-to-inches, and miles-to-meters. Any help on how to do this would be great!
Reply With Quote
  #2  
Old 10-09-2005, 08:22 PM
MikeJ's Avatar
MikeJ MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,742
Default

Just multiply variables by their conversion factor:
Code:
'Inches to centimeters Label1.Text = CDbl(Text1.Text) * 2.54 ' 'etc. etc.
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #3  
Old 10-09-2005, 08:34 PM
Spazztic2003 Spazztic2003 is offline
Newcomer
 
Join Date: Oct 2005
Location: Michigan, USA
Posts: 5
Default

Thank you very much!

Wow man, you are a LIFESAVER! I know that was a simple thing, but WOW. Thanks for the fast reply, AND the help. I pass now!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->