HOW TO MAKE A UNIT CONVERTER IN C# WINDOWS FORM

HOW TO MAKE A UNIT CONVERTER IN C# WINDOWS FORM :

If you are trying to make a UNIT CONVERTER then this article will surely guide you ..


HOW TO MAKE FORMS IN VISUAL STUDIO ?



  • Add Tab Control from the tool box.. 
  • Add more TabPages from Properties
  •  And also change the Text of TabPage to Length , Area , Volume , Temperature , Weight and Time ..

 Your  form will now look  like the picture given below :


You can also change the Text of your Form from Properties ..
Add two Text Box , List Box , Label , Button from ToolBox.. Do the same for all TabPages .. Change the text of Button & Label...
You must change the name of  Text Box (txtLengthTo, txtLengthFrom), List Box (lstLengthTo , txtLengthFrom), Label (lblLengthTo , lblLengthFrom) , Button (btnLengthTo , btnLengthFrom) from Properties. Do the same for  Area , Volume , Temperature , Weight and Time..
Add Items from Properties ... Collection include :

  • Meter
  • Kilometer
  • Centimeter
  • Millimeter
  • Micrometer
  • Nanometer
  • Mile 
  • Yard
  • Foot 
  • Inch
for Length.. 


HOW TO CODE FOR CONVERSION?

Do Double Click on the Convert button and write the code which will convert the Units.. For example ,
For Meter & Kilometer :
 For Example: 1 meter = 0.001 km
You can find more conversions on 
Check the output after 1st conversion:


Then ,
Do the same for ,
  • Meter To Meter
  • Meter To Centimeter 
  • Meter To Millimeter
  • Meter To Micrometer
  • Meter To Nanometer
  • Meter To Mile 
  • Meter To Yard
  • Meter To Foot 
  • Meter To Inch
  • Centimeter To Meter
  • Centimeter To Centimeter 
  • Centimeter To Millimeter
  • Centimeter To Micrometer
  • Centimeter To Nanometer
  • Centimeter To Mile 
  • Centimeter To Yard
  • Centimeter To Foot 
  • Centimeter To Inch
  • Millimeter To Meter
  • Millimeter To Centimeter 
  • Millimeter To Millimeter
  • Millimeter To Micrometer
  • Millimeter To Nanometer
  • Millimeter To Mile 
  • Millimeter To Yard
  • Millimeter To Foot 
  • Millimeter To Inch
  • Micrometer To Meter
  • Micrometer To Centimeter 
  • Micrometer To Millimeter
  • Micrometer To Micrometer
  • Micrometer To Nanometer
  • Micrometer To Mile 
  • Micrometer To Yard
  • Micrometer To Foot 
  • Micrometer To Inch
  • Mile  To Meter
  • Mile To Centimeter 
  • Mile  To Millimeter
  • Mile  To Micrometer
  • Mile To Nanometer
  • Mile To Mile 
  • Mile To Yard
  • Mile To Foot 
  • Mile To Inch
  • Yard To Meter
  • Yard To Centimeter 
  • Yard To Millimeter
  • Yard To Micrometer
  • Yard To Nanometer
  • Yard To Mile 
  • Yard To Yard
  • Yard To Foot 
  • Yard To Inch
  • Foot To Meter
  • Foot To Centimeter 
  • Foot To Millimeter
  • Foot To Micrometer
  • Foot To Nanometer
  • Foot To Mile 
  • Foot To Yard
  • Foot To Foot 
  • Foot To Inch
  • Inch To Meter
  • Inch To Centimeter 
  • Inch To Millimeter
  • Inch To Micrometer
  • Inch To Nanometer
  • Inch To Mile 
  • Inch To Yard
  • Inch To Foot 
  • Inch To Inch
The only change in your CODE is you have to change the name of Unit & the number which after multiply or divide convert a number from one unit to another..Like ,


The Units for Temperature are :

  • Celsius
  • Kelvin 
  • Fahrenhiet
The collection of Units for Area are :
  • Square meter
  • Square kilometer
  • Square centimeter
  • Square millimeter
  • Square micrometer
  • Hectare
  • Square mile
  • Square inch
  • Square foot
  • Square yard
  • Acre
The collection of Units for Volume :
  • Cubic meter
  • Cubic kilometer
  • Cubic centimeter
  • Cubic millimeter
  • Liter
  • Milliliter
  • Cubic Mile
  • Cubic inch
  • Cubic foot
  • Cubic yard
The collection of Units for Weight are:
  • Kilogram
  • Gram
  • Milligram
  • Metric Ton
  • Long Ton
  • Short Ton
  • Pound
  • Ounce
  • Carrat
  • Atomic Mass Unit
The collection of Units for Time are:
  • Second
  • Millisecond
  • Microsecond
  • Nanosecond
  • Picosecond
  • Minute 
  • Hour
  • Day 
  • Week
  • Month
  • Year
---------------------------------------------------------------------------------
Hope this documentation guides you completely . If you find any difficulty then you are free to ask in the comment section.

Post a Comment

5 Comments

  1. Man, what a crazy story. I'll probably share this with some of my friends. Thanks again for posting it.
    mediaonlines.com

    ReplyDelete
  2. Good blog along with the excellent quality stuff and I’m sure this will be greatly helpful.
    Sex Toys

    ReplyDelete
  3. The similar operation is possible with the right choice of tools. The presented method will allow you to complete successfully each of the items

    ReplyDelete
  4. When I was studying in university, this theme was always complicated to me. Fortunately, I had a good teacher, who explained me all aspects.

    ReplyDelete