VB 2008 Metric Unit Converter?
Aug 24, 2010
i am new to VB and am trying to make a metric to imoerial unit converter in VB 2008. I have created a form with 2 list box's with MM, CM, KM etc ....... and the other Inches Miles etc I have added 2lables with convert from and convert to and also 2 blank text box's the first one to choose the number i would like to convert and another to show the converted unit, I have also added a convert button.I am really struggling to find the correct code to make this work.
View 2 Replies
ADVERTISEMENT
Apr 12, 2011
Does anyone have a nice sample of a unit convertor handling multiple unit types that I can integrate in my application? I have found this one, but it is only handling one type of unit. For example I want to convert weight as well as volume from and to imperial units.
View 8 Replies
Sep 17, 2011
I'm a bit new to these forums but anyways let me get to the point. I'm trying to make a Unit Conversion Program on VB 08 and I am trying to make it so I don't use too many radio buttons, however I may use it if there is no other option. And I also have to make the program do it both ways
For Example I want to convert Fahrenheit to Celsius and Celsius to Fahrenheit in the same textbox or some sort of box.
View 9 Replies
Oct 13, 2011
how to convert a metric unit to standard. I will be converting Feet/Inches to Meters/Centimeters and vise versa as well as pounds/ounces to kilograms/grams and vise versa. I can input the values into my Textbox to where it reads " x'y" ," however, when I go to code the Convert button (the same button has to be used for all conversions) how to separate out the text and then perform the conversion.
View 7 Replies
Jul 3, 2009
I'm trying to make a metric to kilogram converter and I am having trouble starting it out. With my Answer label being txtAnswer and the Inches button being btnInches, I have ran into snags with trying to get it formulate the 37, 370 into 1 Kilometer I believe that it needs to be a sring but I am stuck.
View 3 Replies
Feb 27, 2011
I am attempting to make a unit converter that converts between km, m, cm, miles, yards, feet, and inches. I have a textbox that is used to input the value to convert followed by a space and the units (i.e., 56 km) and a second textbox where the user types what unit they want to convert to (i.e., cm). When converting, the output will be displayed in the second textbox. (I know this is complicated, but this is the way it is to be done). I am doing this using sub and function procedures and If blocks and Select Case blocks (i.e., keeping it as simple as possible).
[Code]....
View 4 Replies
Jul 21, 2010
I have written one application which communicate with one data logger unit (temperature monitoring unit) and download records after some interval. Unit continuously send current temperature which I have to show on screen and after each one hour I have to download log (all records saved inside unit at max 1024) from unit.
Now problem is after downloading log, application get hang or what we called working in background and resume after some time. If I pause debugger in visual studio 2008 it show control at application start (sub main) with message as "application will resume here after completing execution of current function". There is nothing in output window. So how can i trace is there any events got spool or what actually application doing in background.
View 1 Replies
Feb 18, 2010
get VB 6.0 to Visual Studio 2008 converter?
View 1 Replies
Oct 19, 2009
Public Class Form1
Dim Character As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
[code]......
View 3 Replies
Dec 26, 2009
It is possible to make a video converter using VB .Net? If yes with what I should start?
View 2 Replies
Feb 22, 2012
So i decided to make a units converter for my term's project and my teacher insisted on including the combo box in this project. I'm not really familiar with the combo box as i am still a beginner in visual basic. I've looked around and learned a bit about using the combo box but later i faced a problem. First i created a Main combo box and placed it in the middle of the form. I managed to use the select case command to make other combo boxes appear and disappear as i wish. I don't really know how to describe the problem, i want to make it that if i choose the input as a unit and the output is any other unit from two different combo boxes, the value in the input text box would be multiplied by a certain conversion factor and the result will be shown in the output text box.
View 1 Replies
Nov 1, 2010
I'm trying to create a program that takes 7 numbers and converts them to Letters. To do this I have created a TextBox to enter the 7 digit number in , a CONVERT Button, and a LIST BOX to display the thousands of results. This is created using a Windows Application Form.
[Code]...
View 4 Replies
Nov 17, 2009
At the moment im tryng to create a celcious to fahrenheit i already got the formula and so i put it into visual basic. My goal is to create a programm with two textboxes
one celcious and the other one fahrenheit.[code...]
THen i realized that loop is created because if i write 12 in celcious it outputs to fahrenheit which outputs back to celcious ecc.. infact when i debug it says
Make sure you do not have an infinite loop or infinite recursion .I would like to have a programm with 2 textboxes. If in one i put 12 then the respective fahrenheit comes out; If in fahrenheit i put 55 then the respective celcious comes out.
View 9 Replies
Jan 20, 2011
after numerous google searches and comparing excerpts from different peoples' various codes I could not get this program to work, though I came quite close. I'm attempting to make a program that will tell me the time in different parts of the world, a personal use program that I thought would help me exercise my vb skills.
The problem I'm having, however, is that when it should be showing my time it is either 5 hours ahead or 5 hours behind. I tried adding variables and deleted them again time and time again trying to make adjustments but all I managed to do was make the timer get stuck at 12:00:00 AM.
[Code]...
View 10 Replies
Feb 19, 2009
I'm running some unit tests for a large VB.Net application I help maintain and am running into problems with tests timing out. The test run is set up so that there's no timeout limit on the overall test run, but a limit of 2 minutes per individual test. However, a couple of the tests take a lot longer than this to run, so we tried adding the timeout attribute to the test's declaration, i.e
<TestMethod(), Timeout(15 * 60 * 1000)> Public Sub DoSomething()
for a 15 minute timeout. However, the 2 minute timeout set in the test run properties seems to be taking precedence, even though it says that the timeout attribute should override it.
View 1 Replies
Jul 27, 2009
I'm trying to make a simple character converter i.e. (A converts to O) or (C converts to V) I need to make defined parameters for the entire alphabet.I have two text boxes set up and a command button. I'm trying to make it so the text inputted into the first textbox is converted (using the defined parameters) Into the second textbox with a click of the button.
View 5 Replies
May 12, 2009
I am trying to create a unit test similar to how I would have done one in C# but am struggling with the lambdas in vb. Bascially I am trying to mock a class and then create a stub and return. In C# I would have done something like;
MockedPersonRepository
.Stub(x => x.Find(id))
.Return(person)
[code].....
View 2 Replies
Feb 9, 2009
Write a program to convert a U.S. Customary System length in miles, yards, feet and inches to a. Metric System length in kilometers, meters, and centimeters.
I found this same project on these boards already however I received an error and was seeing if someone could see what I did wrong.
My error message is: 'lstResult' is not declared
Public Class lengthConversion
Private Sub convertBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertBtn.Click
[Code].....
View 7 Replies
Nov 25, 2008
[Code]...
Declare constants for all numeric values in the two formula above. The variable used to represent the number of meters and the numeric constant 39.37 must be declared as the data type double. the constants and data types in the first formula should be declared as integers. Convert the Total Inches in the second formula to a Double data type before using it in the calculation. Set Option Strict to on in your code. (Hint: After the number of meters has been determined, the maximum number of kilometers can be computed from Kilometers = Meters/1,000. Next, the remaining meters can be determined from: Remaining Meters = Meters - 1,000 * Kilometers. The number fo integer meters in Remaining Meters then can be determined from: Integer Meters = Convert.ToInt32(Remaining Meters). Continue with the same technique to compute the number of centimeters.)
[Code]...
View 4 Replies
Aug 16, 2011
Im trying to convert the English system into the metric system in visual basic, here is what i have so far
Sub Metric()
Dim num As Single
num1 = InputBox(" enter feet...")
num2 = InputBox(" enter inches...")
View 5 Replies
Jan 24, 2010
ive got to create a BMI calculator using metric units, when i enter my data, it doesnt work (i put in 1.5m and 90kg but the answer comes out at 3, and in clearly not anorexic heres what ive got at the moment
Dim BMIResults As New frmBMIResults
Dim Answer As Integer
Dim BMIAnswer As Integer
Answer = CType(tbHeight.Text, Integer) * 2
BMIAnswer = CType(tbWeight.Text, Integer) Mod Answer
'BMIResults.Show()
'Me.Hide()
View 3 Replies
Jul 15, 2009
anyone know how to use metric to do the tree view system ?????
View 4 Replies
May 30, 2011
I'm looking for a fast way of searching a textbox containing plain text mixed with coordinate values.These coordinate values may contain no decimals or 4 decimal places after the decimal.I'm somewhat familiar with regex, but my uncertainty is the actual number of characters in each word will be different.[code]
View 2 Replies
Oct 25, 2011
im trying to create a program that will convert between metric and standard units.I chose length as my measurement so i have nanometer,millimeter,centimeter,meter,hectometer,kilometer,inc,feet,yard and mile.i wanted the input to be
- number to be converted(text box)
-unit number is in(combo box)
-unit to convert to(combo box)
i know how to do combo boxes,buttons and labels and stuff.The output is the converted number this is what i have so far but its soooo wrong?
Public Class Form1
Private Sub Convert_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Convert.Click
Dim Inch, Feet, Yard, Mile As Integer
Dim Nanometer, Millimeter, Centimeter, Meter, Hectometer, Kilometer As Double
[code]....
View 1 Replies
Jun 12, 2011
Write a program to convert a U.S. Customary System length in miles, yards, feet and inches to a. Metric System length in kilometers, meters, and centimeters.My error message is: 'lstResult' is not declared
Public Class lengthConversion
Private Sub convertBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertBtn.Click
Dim miles, yards, feet, inches As Double
[code]....
View 2 Replies
Apr 1, 2009
I am having a bit of an issue and would like some opinions. I have a settings class that I use in my program that gets passed around to various pieces of the program. When the program exits, the settings class is serialized out to an xml file. When the program starts the settings class is serialized back from the xml file.If the program doesn't find an existing xml file, the defaults in the class are used and a new xml file is created when the program exits.This all works well. Here is a trimmed down version of my settings class:
Public NotInheritable Class UserSettings
Private _Length As Double = 10 'feet
Private _Name As String = "Inert Material"
[code]....
The problem that I am having is that if the program units are metric, then the default values are always converted in the constructor and the xml serializer then stuffs the values that exist in the configuration (over writing the converted default value which is what I want) into the proper properties. The reason for this behavior is to make sure that that new properties that don't exist in the xml file have a proper default value when metric units are required.
It seems wasteful to convert all of the default values every time when working with metric units? Is there a better way to do this? My full class has currently about 15 default values that need to be converted to metric equivalents. Ideally I would only like to convert values that haven't come from the xml file.
View 2 Replies
Jun 1, 2011
When the program exits, the settings class is serialized out to an xml file. When the program starts the settings class is serialized back from the xml file.If the program doesn't find an existing xml file, the defaults in the class are used and a new xml file is created when the program exits.This all works well. Here is a trimmed down version of my settings class:
Public NotInheritable Class UserSettings
Private _Length As Double = 10 'feet
Private _Name As String = "Inert Material"
[code].....
View 2 Replies
Mar 3, 2011
I am making a program that calculates various results with variables entered by the user. What I am trying to do is incorporate a function that will allow the user to switch from metric to imperial easily but only when the ok button is pressed. Now I got all the coding done for the metric and everything is working fine. My problem is when I use the radiobuttons to switch the entered variable in the text box to the desired unit it gives me a 0 or a random number in the textbox...
I also have labels indicating each variables unit which I easily managed to change with the text box using this code. :
'Change Labels to Metric
lblMDegreeC.Text = "Degree C"
lblMDegreeC2.Text = "Degree C"
lblMmm.Text = "mm"
lblMmm1.Text = "mm"
lblMmm2.Text = "mm"
lblMm.Text = "m"
lblMm2.Text = "m"
lblMm3.Text = "m"
lblMDegreeC3.Text = "Degree C"
I created all the coding to convert the metric variables to imperial. My problem is changing the textbox text when the user switches the units during run time. The labels change without a problem but the textbox never works. I have attached the coding for the file.
View 4 Replies
Feb 15, 2011
Anyways, i have coded a video downloaded and i want to include a converter as a separate exe file. But obviously people may have different file directories so a simple piece of code i have used won't work. This is what i have: Also where would i place the exe file?
View 3 Replies
Jan 16, 2010
What code can you use to get the unit in a currency?
For example in 10,340.55 there is:
10 units for a thousand.
3 units for hundreds
4 units of tens.
1 fifty cent
1 five cent.
View 4 Replies