Project help needed

help needed , project , vb.net Singapore
  • 7 years ago

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' declare constants and variables Dim cm As Integer Dim m As Double Dim g As Integer Dim kg As Double mtextbox.Text = "" kgtextbox.Text = ""

    ' converting from cm to m Integer.TryParse(cmTextBox.Text, cm) m = cm / 100

    ' converting from g to kg Integer.TryParse(gtextbox.Text, g) kg = g / 1000

    ' display the converted result (cm to m) If user enter integer then display = "m"

    Else MessageBox.Show("Please enter a number.")

    End If

    ' display the converted result (g to kg) If user enter integer then display = "kg"

    Else MessageBox.Show("Please enter a number.")

    'set focus mtextbox.Focus() kgtextbox.Focus()

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click cmtextbox.Text = "" gtextbox.Text = "" End Sub End Class

    My project topic is on data conversion for length and weight. There is something wrong with the code. Can anybody help me. Thanks in advance. I need to hand in on 22/1/10. Please reply asap.

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Some people, when confronted with a problem, think "I know, I’ll use regular expressions." Now they have two problems.” - Jamie Zawinski